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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mnemecek23
New Member

Same Y axis based on DAX MAX formula

Hi all,

 

I am trying to build a report which has multiple graphs showing accepted volume at the individual locations in our network.

 

Each graph is filtered down for a specific location and looks something like this:

 

mnemecek23_1-1685536661587.png

In order to show the correct proportion, I need the y-axis to be the same for all locations. Together with a colleague, we thought of using the MAX formula:

 

MAX = CALCULATE(MAX(VW_BI_KPI[ACCEPTED]),REMOVEFILTERS(VW_BI_KPI[LOCATION]))
 
which works fine, but...
 
Each location handles a multitude of different service keys. The above formula works out only if the data is filtered for one service key, but fails when it's two or more (it then gives the maximum accepted value for a single service key). I need two steps:
 
1) SUM of the volume per location across all service keys
2) the maximum of the above figure
 
The underlying data looks like this:
 
mnemecek23_0-1685536621957.png
 
Any suggestions how to achieve this?
 
Many thanks!

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

Max Y Axis =
VAR SummaryTable =
    ADDCOLUMNS (
        SUMMARIZE ( ALL ( VW_BI_KPI ), VW_BI_KPI[Location], 'Date'[Date] ),
        "@value", CALCULATE ( SUM ( VW_BI_KPI[Accepted] ) )
    )
VAR Result =
    MAXX ( SummaryTable, [@value] )
RETURN
    Result

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Try

Max Y Axis =
VAR SummaryTable =
    ADDCOLUMNS (
        SUMMARIZE ( ALL ( VW_BI_KPI ), VW_BI_KPI[Location], 'Date'[Date] ),
        "@value", CALCULATE ( SUM ( VW_BI_KPI[Accepted] ) )
    )
VAR Result =
    MAXX ( SummaryTable, [@value] )
RETURN
    Result

Awesome, exactly what I needed! Thanks a lot!!

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

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