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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Wrong Totals in a conditional measure

I have a conditional measure that is showing the wrong subtotals and totals in a matrix visualization.

 

The measure works like this:

If a worker is a contractor then I have to add all the hours they logged in Schedule. If the worker is not a contractor then I have to take the Defined Month Hours from the Calendar table. See example formula below:

 

Month Hours =IF(MAX(WorkerData[Type])="Non Contractor", SUM('Calendar'[Defined Month Hours]),CALCULATE(SUM(Schedule[HOURS]))

 

If I check each worker everything works correctly, but when checking the totals or subtotals, only Non Contractors are being added.

See example:

BossWorkerMonth Hours
Boss Subtotal 100
 Worker 1 (Non contractor)50
 Worker 2 (Non contractor)50
 Worker 3 (Contractor)5
Total 100

 

I would appreciate any help with the issue was I have been finding solutions but not for this specific type of scenario.

 

Thanks.

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Please see this video for how to solve this. You likely need to use something like this (replacing T1 with your actual table name.

 

NewMeasure = SUMX(Summarize(T1, T1[Boss], T1[Worker]), [YourMeasure])

 

(2) Power BI - Tales from the front #01 - Getting the Right Total - YouTube

 

Pat

Microsoft Employee

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

Measure = SUMX(VALUES(WorkerData[Type]),[Month hours])


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ppm1
Solution Sage
Solution Sage

Please see this video for how to solve this. You likely need to use something like this (replacing T1 with your actual table name.

 

NewMeasure = SUMX(Summarize(T1, T1[Boss], T1[Worker]), [YourMeasure])

 

(2) Power BI - Tales from the front #01 - Getting the Right Total - YouTube

 

Pat

Microsoft Employee
Anonymous
Not applicable

I am afraid that the boss and the worker are at different tables.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.