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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.