cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Fixed total by ignoring one slicer

Hi, 

 

I have seen this question many times, but I don't get the solution to work. 

 

I have two measures: YTD_endringer and YTD_benchmark

 

The first measure should calculate the cumulative total, based on the slicer. The second should be fixed, calculating the total ignoring the the slicer.

 

My measure looks like this, using the all() function to ignore to no prevail.

 

YTD_benchmark = CALCULATE(
    SUM(endringer[ANTALL]), 
    FILTER(
        ALLSELECTED(endringer),
        endringer[WeekNumber] <= MAX(endringer[WeekNumber])
        && endringer[DATO].[Year]= MAX(endringer[DATO].[Year])
    ), all(endringer[KUNDE])
)

 

 

p1.PNGp2.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Any help is much appreciated, thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: Fixed total by ignoring one slicer

Maybe:

YTD_benchmark = CALCULATE(
SUM(endringer[ANTALL]),
FILTER(
ALL(endringer),
endringer[WeekNumber] <= MAX(endringer[WeekNumber])
&& endringer[DATO].[Year]= MAX(endringer[DATO].[Year])
)
)

---------------------------------------

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

7 REPLIES 7
Highlighted
Super User IX
Super User IX

Re: Fixed total by ignoring one slicer

Maybe:

YTD_benchmark = CALCULATE(
SUM(endringer[ANTALL]),
FILTER(
ALL(endringer),
endringer[WeekNumber] <= MAX(endringer[WeekNumber])
&& endringer[DATO].[Year]= MAX(endringer[DATO].[Year])
)
)

---------------------------------------

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Highlighted
Helper I
Helper I

Re: Fixed total by ignoring one slicer

It worked like a charm, but could you explain why? Wasn't too intuitive based on other solutions I have seen. 

Highlighted
Super User IX
Super User IX

Re: Fixed total by ignoring one slicer

Probably an order of operations kind of thing with the FILTERs you had. The ALLSELECTED was filtering based on KUNDE and then your ALL kicked in but at that point the data was already filtered by KUNDE.

---------------------------------------

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Helper I
Helper I

Re: Fixed total by ignoring one slicer

I see, thank you for the help! 

Highlighted
Helper I
Helper I

Re: Fixed total by ignoring one slicer

Sorry @Greg_Deckler , I was celebrating pre-maturaly.

By putting all(endringer) it ignores all the slicers, whilst I would like it to only ignore just one specific. 
Is there a way to kind of turn on the others, but still ignoring just the one? 

Highlighted
Helper I
Helper I

Re: Fixed total by ignoring one slicer

For completion, it works with allexcept(table, col1, col2, etc), except the one I want to ignore. It's a litte bit hacky, if I would have a ton of slicers. Luckily - I do not. 

Highlighted
Super User IX
Super User IX

Re: Fixed total by ignoring one slicer

Yeah, another way of doing it would likely be to use REMOVEFILTERS function which you would want to do if you had tons of slicers.


---------------------------------------

Not link spamming! If I posted a link in reply it is because I did assume you know how to search the web but thought it was the fastest way to fix your issue.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors