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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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])

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.