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
PowerRon
Post Patron
Post Patron

How to get max value of two colums?

Hi,

This is my bar chart.
In the legend the 'Year' (column of Date table), the Y-axis 'Region' (column of Country table), the X-axis 'Sum Quantity'
The bar overlaps sometimes the labels. To prevent that I want to compute a MAX value and compute it with 1.2
This computed measure I will then put in X-axis / Range / Maximum
knip1.jpg

If I wouldn't have a legend, the next measure would work

_Max X = MAXX(VALUES('Regions'[Domestic]),[Sum Quantity]) * 1.2

But if I use this measure with the legend, this happens

knip2.jpg

_Max X becomes (35K + 35K + 16K) * 1.2
But it should become 35K (being the highest value for a single bar) * 1.2

Of course I have to embed the legend (Year) as well in my measure.
How do I do that?

Regards
Ron
1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@PowerRon , Try using

DAX
_Max X =
MAXX(
SUMMARIZE(
'YourTable',
'Date'[Year],
'Country'[Region],
"SumQuantity", [Sum Quantity]
),
[SumQuantity]
) * 1.2




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

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
bhanu_gautam
Super User
Super User

@PowerRon , Try using

DAX
_Max X =
MAXX(
SUMMARIZE(
'YourTable',
'Date'[Year],
'Country'[Region],
"SumQuantity", [Sum Quantity]
),
[SumQuantity]
) * 1.2




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

Proud to be a Super User!




LinkedIn






Thnx @bhanu_gautam , it works

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.