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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
FAA9
Frequent Visitor

Summing conditional measure

Hello,
I have a measure which is conditioned on the value of two other measures (whose values are shown as columns in the table below). I am getting correct numbers on rows, but subtotals are not correct. 

 

In the table below, the last column (corrected supplies) is conditioned on supply vs demand. If supply is >150% of demand, then it takes demand*1.5, otherwise it takes the value in supply column (1st one which is a calculated measure itself).

The correct total is 22,029. However with my measure I get the same total as the 1st column (as I am unable to add row context to the IF condition).
Please help on how to resolve this

FAA9_2-1662923440543.png

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this video. You need to use SUMX iterating over a SUMMARIZE of item, type, subtype, and region referencing your Corrected Supplies measure.

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

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this video. You need to use SUMX iterating over a SUMMARIZE of item, type, subtype, and region referencing your Corrected Supplies measure.

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

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi, I tried using that bit didnt work for me 😞

 

It looks sowmthing like this but I tried using different versions. Nothing seems to be working:

 

FAA9_0-1662960835023.png

 

SUMX(SUMMARIZE(Main_tbl, Main_tbl[_date],Main_tbl[_type], Main_tbl[Key]), CALCULATE( [Corrected Supplies]))

Corrected Supplies = If (Y > 1.5, 1.5*Demand(X), W)

(in the table all are measures btw everything is calculated based on some date restrictions)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

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.