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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PowerBI-Newbie
Helper IV
Helper IV

Maximum value from a measure based on legend

Hi,

I'm trying to work out the maximum value from a measure based on the Year:Period and use this as the maximum Y-Axis. Based on the following measure which I got from a YouTube video, I'm able to get the maximum Y-Axis value (962 x 1.1=1.06k) based on the Year:Period column in my table:

Measure:

MaxChart All Faults Count - All = 
CALCULATE(
    MAXX(
        ADDCOLUMNS(DISTINCT(ALL(Issues[Year:Period])),"AllCount",[All Faults Count - All]),[AllCount])*1.1,
        All(Issues[Status])
)

 

Screenshot:

PowerBINewbie_1-1722345972646.png

 

 

But as soon as I add a legend I don't know how to update the measure to get the maximum based on the Status column across all Year:Period. From the screenshot below the maximum Y-Axis should read 716.1 (561 x 1.1).

PowerBINewbie_0-1722345712273.png

 

Any help is greatly appreciated.

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @PowerBI-Newbie -Can you try below measure with slight adjustments

 

MaxChart All Faults Count - All with Status =
CALCULATE(
MAXX(
ADDCOLUMNS(
SUMMARIZE(ALL(Issues), Issues[Year:Period], Issues[Status]),
"AllCount", [All Faults Count - All]
),
[AllCount]
) * 1.1,
REMOVEFILTERS(Issues[Status])
)

 

this measure should adjust dynamically based on the maximum fault count for each combination

Hope it works

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 





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

Proud to be a Super User!





View solution in original post

Hi @rajendraongole1 ,

I ended up having a play before you responded and found that I can do the following which also worked:

MaxChart All Faults Count - All = 
CALCULATE(
    MAXX(
        ADDCOLUMNS(DISTINCT(ALL(Issues[Year:Period],Issues[Status])),"AllCount",[All Faults Count - All]),[AllCount])*1.1,
        All(Issues[Status])
)

 

I tested yours and it also worked for me so thank you.

View solution in original post

2 REPLIES 2
rajendraongole1
Super User
Super User

Hi @PowerBI-Newbie -Can you try below measure with slight adjustments

 

MaxChart All Faults Count - All with Status =
CALCULATE(
MAXX(
ADDCOLUMNS(
SUMMARIZE(ALL(Issues), Issues[Year:Period], Issues[Status]),
"AllCount", [All Faults Count - All]
),
[AllCount]
) * 1.1,
REMOVEFILTERS(Issues[Status])
)

 

this measure should adjust dynamically based on the maximum fault count for each combination

Hope it works

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 

 





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

Proud to be a Super User!





Hi @rajendraongole1 ,

I ended up having a play before you responded and found that I can do the following which also worked:

MaxChart All Faults Count - All = 
CALCULATE(
    MAXX(
        ADDCOLUMNS(DISTINCT(ALL(Issues[Year:Period],Issues[Status])),"AllCount",[All Faults Count - All]),[AllCount])*1.1,
        All(Issues[Status])
)

 

I tested yours and it also worked for me so thank you.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.