Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
rathimd
Frequent Visitor

Calculate column returning multiple values in if condition

Hi ,

 

1) Using Column 

When I am passing column else condition in below query it is giving returing me single value.

Mark-up Cost Actual - Salary =

IF(

     RELATED(

         Employees[Rank Code]

         )

         = 9050,

         DIVIDE(

             SUM('Time & Billing'[PROD_TIME_AMT]),

             SUM('Time & Billing'[PROD_TIME_HRS])

             ),

Related(Employees[Actual Rate])

 

2)Using Measure

When I am passing measure in else condition in below query it is returing multiple value

Mark-up Cost Actual - Salary 1 =

IF(

     RELATED(

         Employees[Rank Code]

         )

         = 9050,

         DIVIDE(

             SUM('Time & Billing'[PROD_TIME_AMT]),

             SUM('Time & Billing'[PROD_TIME_HRS])

             ),

[Labor Rate Salary]))

 

This is the measure and it is returning correct value 

[Labor Rate Salary] =

 ((SUM(Employees[Salary($)]) * [STD Hrs (%)])/[Total Charge Hours]

)

 

1 ACCEPTED SOLUTION

@rathimd , try like

IF(
Max( Employees[Rank Code] ) = 9050,
DIVIDE(
SUM('Time & Billing'[PROD_TIME_AMT]),
SUM('Time & Billing'[PROD_TIME_HRS])
),
[Labor Rate Salary])

View solution in original post

2 REPLIES 2
rathimd
Frequent Visitor

@rathimd , try like

IF(
Max( Employees[Rank Code] ) = 9050,
DIVIDE(
SUM('Time & Billing'[PROD_TIME_AMT]),
SUM('Time & Billing'[PROD_TIME_HRS])
),
[Labor Rate Salary])

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.