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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Kebas_Leech
Helper I
Helper I

Summarize with ALL

Hello everyone,

 

I have the following function:

 

 

YEAR | MAX =
VAR vals = 
                SUMMARIZE(
                 'Date' ,
                 'Date'[Year],
                 "myMeasure", CALCULATE([Prod | Max | AllY],  ALL('Date'))
               )
    VAR measureMax = MAXX(vals, [myMeasure])
    VAR y_value = calculate(MAXX(FILTER(vals, [myMeasure] = measureMax), 'Date'[Year]))
RETURN
    y_value

 

 

 

The measure [Prod | Max | AllY] is:

 

 

 

calculate(MAXX(BD,BD[Production]), ALL('Date'[Year]))

 

 

 

Both tables (BD and Date) are connected via Date[Date] -> BD[Date] in a 1-to-many relationship both directions.

 

I checked the var measureMax and its working properly. 

The var y_value is however, wrong! Its returning the year as if the ALL function wasn't there.

 

I tried different approaches (like addcolumns and so on) but with no success.

What am I missing?

Thank you.

 

1 ACCEPTED SOLUTION
Kebas_Leech
Helper I
Helper I

Solution was:

 

 

VAR MaxValue = calculate([Prod | Max | AllY], ALL('Date'[Year]))
RETURN
    CALCULATE(
        MAX('Date'[Year]),
        FILTER(
            ALL('Date'[Year]),
            [Prod | Max | AllY] = MaxValue
        )
    )

 

 

View solution in original post

1 REPLY 1
Kebas_Leech
Helper I
Helper I

Solution was:

 

 

VAR MaxValue = calculate([Prod | Max | AllY], ALL('Date'[Year]))
RETURN
    CALCULATE(
        MAX('Date'[Year]),
        FILTER(
            ALL('Date'[Year]),
            [Prod | Max | AllY] = MaxValue
        )
    )

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors