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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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