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
blazko
Helper III
Helper III

MAX of calculation, with filter

Hi, I have small problem with creating a measure. Here's what I got:

max/day = IF(
    ISFILTERED('a/b'[a/b]);
    MAXX(
        'BASE data';CALCULATE(SUM('BASE data'[qty]);ALLEXCEPT('BASE data';'BASE data'[date];'BASE data'[a/b])));
    MAXX(
        'BASE data';CALCULATE(SUM('BASE data'[qty]);ALLEXCEPT('BASE data';'BASE data'[date]))))

And I have problem this working with a "a/b" slicer. 

It should calculate max of qty sum calculated by a day, from selected time period. In this example a date hierarchy in matrix visual, with a drill down option through year, quarter, month, week.

The problem is I figured out something that works only partially. With one or none selection (isfiltered: true/false). What i want is that this calculation worked also with both options selected on slicer (sum a+b).

Thx in advance for any reply.

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @blazko,

 

Maybe you can try to use below measure if it works for your requirement:

Check Range =
MAXX (
    SUMMARIZE (
        FILTER (
            ALLSELECTED ( 'BASE data' );
            'BASE data'[a/b] IN ALLSELECTED ( 'a/b'[a/b] )
        );
        [date];
        [a/b];
        "SUM"; SUM ( 'BASE data'[qty] )
    );
    [SUM]
)

If above not help, please provide some sample data for analysis.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi, thanks for the responce, sadly yours solution wasnt working for me. 
Found one of my own, simple:

max  = MAXX(calculated_date;MAXX(calculated_date;CALCULATE(SUM('BASE data'[qty]))))

And it calculates through all the slicers I can get from the table, not only "a/b".

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.