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
janislv
Helper I
Helper I

MAXX - can't get off filter

Ok, maybe I'm dumb, but what could be wrong with this measure? I'm trying to get the max value and ignore the time filter.

 

Max difference =
VAR table_x =
ADDCOLUMNS (
'Hourly calendar',
"input", [Input measure],
"output", [Output measure]
)
VAR max_difference =
CALCULATE ( MAXX ( table_x, [input] - [output] ), ALL ( 'Hourly calendar' ) )
RETURN
max_difference

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

Once you define a variable, it's fixed and will not be modified by CALCULATE adjusting filter context.

 

See if this works better:

Max difference =
VAR table_x =
    ADDCOLUMNS (
        ALL ( 'Hourly calendar' ),
        "input", [Input measure],
        "output", [Output measure]
    )
VAR max_difference = MAXX ( table_x, [input] - [output] )
RETURN
    max_difference

View solution in original post

2 REPLIES 2
janislv
Helper I
Helper I

Thank You, @AlexisOlson ! Bingo!

AlexisOlson
Super User
Super User

Once you define a variable, it's fixed and will not be modified by CALCULATE adjusting filter context.

 

See if this works better:

Max difference =
VAR table_x =
    ADDCOLUMNS (
        ALL ( 'Hourly calendar' ),
        "input", [Input measure],
        "output", [Output measure]
    )
VAR max_difference = MAXX ( table_x, [input] - [output] )
RETURN
    max_difference

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!

December 2024

A Year in Review - December 2024

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