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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mikey268
New Member

LOD Expression from Tableau

hi,

 

I want to create a calculation on top of a LOD expression similar to this.

 

MAXSALES = {Fixed Country : MAX(SALES)} which im doing by

MAXSALES = CALCULATE(MAX('Table1''Sales'),ALLEXCEPT('Table1',Table1[country]))

I want to SUM(MAXSALES) and use it in another calculation to achieve sum(individual sales) / SUM(MAXSALES)

 

Can someone please help.

Thanks in Advance.

1 ACCEPTED SOLUTION

Hi @mikey268 ,

 

Try this:

Measure = SUMX(SUMMARIZE('Table'; 'Table'[Quarter]; 'Table'[Part]; "Total"; MAX('Table'[Cost])); [Total])
 
Capture.PNG

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

5 REPLIES 5
camargos88
Community Champion
Community Champion

Hi @mikey268 ,

 

You can use CALCULATE(MAX('Table1''Sales'),ALL('Table1')), it will get the max value for this table.

 

Howerver, it's better if you provide a sample data. So we can check it better.

 

Ricardo



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi here is the context.

 

I want to write this in power bi:

 

SUM({FIXED DIM1, DIM2 : MAX(measure)})

Hi @mikey268 ,

 

I would say you need to aggregate first with summarize and sum them.

Can you give some example about it ? 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Hi, thanks for the response. something like this. I would do SUM({FIXED Quarter, Part : MAX(cost)}

 

QuarterPartCost
2020Q1A100
2020Q1A100
2020Q1A100
2020Q1B200
2020Q1B200
2020Q1B200
2020Q1B200
2020Q1C300
2020Q1C300
2020Q1C300
2020Q2A200
2020Q2A200
2020Q2A200
2020Q2B100
2020Q2B100
2020Q2B100
2020Q2C400
2020Q2C400
2020Q2C400

 

Result:

ResultPart Cost
2020Q1600
2020Q2700

Hi @mikey268 ,

 

Try this:

Measure = SUMX(SUMMARIZE('Table'; 'Table'[Quarter]; 'Table'[Part]; "Total"; MAX('Table'[Cost])); [Total])
 
Capture.PNG

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.