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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
jmarcrum
Helper II
Helper II

SUM of MAX values in a table

Hi all - I'm trying to reproduce an LOD expression (from Tableau) in Power BI. 

{ FIXED [Schedule Period], [Schedule Query], [Site] : MAX( [NAH] ) }

 

NAH is the difference between two other columns.

 

What is the easiest way to do this in Power BI?

 

4.png

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @jmarcrum 

 

A measure like this should give the same result for that particular visual:

Max NAH Measure = 
SUMX ( 
    SUMMARIZE (
        YourTable,
        YourTable[Site],
        YourTable[Schedule Period],
        YourTable[Schedule Query]
    ),
    CALCULATE ( MAX ( YourTable[NAH] ) )
)

Here I've used SUMMARIZE to return a table with the required granularity, and then used SUMX over this table to sum the max values.

 

To exactly replicate the behaviour of the FIXED LOD (which would ignore filters aside from Site, Schedule Period and Schedule Query) you could also write:

Max NAH Measure = 
SUMX ( 
    SUMMARIZE (
        YourTable,
        YourTable[Site],
        YourTable[Schedule Period],
        YourTable[Schedule Query]
    ),
    CALCULATE (
        MAX ( YourTable[NAH] ),
        ALLEXCEPT (
            YourTable,
            YourTable[Site],
            YourTable[Schedule Period],
            YourTable[Schedule Query]
        )
    )
)

 

Hopefully that's of some use.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

1 REPLY 1
OwenAuger
Super User
Super User

Hi @jmarcrum 

 

A measure like this should give the same result for that particular visual:

Max NAH Measure = 
SUMX ( 
    SUMMARIZE (
        YourTable,
        YourTable[Site],
        YourTable[Schedule Period],
        YourTable[Schedule Query]
    ),
    CALCULATE ( MAX ( YourTable[NAH] ) )
)

Here I've used SUMMARIZE to return a table with the required granularity, and then used SUMX over this table to sum the max values.

 

To exactly replicate the behaviour of the FIXED LOD (which would ignore filters aside from Site, Schedule Period and Schedule Query) you could also write:

Max NAH Measure = 
SUMX ( 
    SUMMARIZE (
        YourTable,
        YourTable[Site],
        YourTable[Schedule Period],
        YourTable[Schedule Query]
    ),
    CALCULATE (
        MAX ( YourTable[NAH] ),
        ALLEXCEPT (
            YourTable,
            YourTable[Site],
            YourTable[Schedule Period],
            YourTable[Schedule Query]
        )
    )
)

 

Hopefully that's of some use.

 

Regards,

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

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 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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