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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
darko861
Resolver II
Resolver II

Measure with condition IF does not summarize in Visual

Hi I have the following visualization which is a Table

 

darko861_0-1619080615943.png

 

The worked hours column is a measure that looks like this 

Worked Hours = IF([Diff]>=0,SUM(v_rpt_apticcustom_Employee_Time_Billingv6[Registered_Hours]),SUM('apticproject view_workedtime'[Worked.1]))
 
as you can see it checks the Diff column: 
Diff = SUM(v_rpt_apticcustom_Employee_Time_Billingv6[Registered_Hours]) -[Worked PW]
 
The Worked Hours gives the correct values but the total 18213 is incorrect
 
So I tried a new measure Worked Hours3: 
Worked Hours3 = sumx(VALUES(PW_ACM_user[Fullname]),IF([Diff]>=0,SUM(v_rpt_apticcustom_Employee_Time_Billingv6[Registered_Hours]),SUM('apticproject view_workedtime'[Worked.1])))
 
Worked Hours3 gives me the exact same correct values but the total 2283955 is incorrect.
 
I would appreciate it if you could give some tips on how to get the visualization to get the correct total of worked hours column?
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@darko861 , more than one group in table, Try like

sumx(summarize(PW_ACM_user,PW_ACM_user[Fullname],PW_ACM_user[Deaprtment], "_1",IF([Diff]>=0,SUM(v_rpt_apticcustom_Employee_Time_Billingv6[Registered_Hours]),SUM('apticproject view_workedtime'[Worked.1]))),[_1])

 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@darko861 , more than one group in table, Try like

sumx(summarize(PW_ACM_user,PW_ACM_user[Fullname],PW_ACM_user[Deaprtment], "_1",IF([Diff]>=0,SUM(v_rpt_apticcustom_Employee_Time_Billingv6[Registered_Hours]),SUM('apticproject view_workedtime'[Worked.1]))),[_1])

 

Thanks @amitchandak it worked great! I really appreciate your contribution to this community.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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