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

Ignoring slicers using mutlple filter expressions in DAX measure

Hi Everybody,

 

I am struggling with a measure in which i want to ignore one of my slicers and for some reason i can't get it to work. I want to build two measures that show me a comparison between most recent report (latest ATB) and my previous report (2nd latest ATB). Through a RANKX column it is determined which report is the most recent and which is the previous one. In the example A below everything seems fine and it shows me the results i am looking for. However, when i start using my version slicer, it will not show my data from the previous report anymore (see example B). This also counts the other way around, when i select version 3 (previous version) it will not show the most recent value anymore.

 

example A

Wilm117_0-1627389884908.png

 

example B

Wilm117_1-1627390138550.png

The values in these tables come from the following measure:

2nd latest ATB = 
CALCULATE(
    SUM('ZPS11_totaal overzicht'[Bedrag]),
FILTER('ZPS11_totaal overzicht', 'ZPS11_totaal overzicht'[Post] = "ATB"),
FILTER('ZPS11_totaal overzicht', 'ZPS11_totaal overzicht'[NPO-WBS] = "NPO"),
FILTER('ZPS11_totaal overzicht', 'ZPS11_totaal overzicht'[RANK COLUMN] = 2))

Latest ATB = 
CALCULATE(
    SUM('ZPS11_totaal overzicht'[Bedrag]),
FILTER('ZPS11_totaal overzicht', 'ZPS11_totaal overzicht'[Post] = "ATB"),
FILTER('ZPS11_totaal overzicht', 'ZPS11_totaal overzicht'[NPO-WBS] = "NPO"),
FILTER('ZPS11_totaal overzicht', 'ZPS11_totaal overzicht'[RANK COLUMN] = 1))

I've also tried calculating  "2nd Latest ATB" as following:

2nd latest ATB = 
CALCULATE(
    SUM('ZPS11_totaal overzicht'[Bedrag]),
FILTER(ALL('ZPS11_totaal overzicht'), 'ZPS11_totaal overzicht'[Post] = "ATB"),
'ZPS11_totaal overzicht'[NPO-WBS] = "NPO" &&
'ZPS11_totaal overzicht'[RANK COLUMN] = 2)

This got me this result:

Wilm117_2-1627390714423.png

 I feel like i am close to my solution, but so far i couldn't figure it out exactly. 

 

Can anybody help me out?

 

 

1 REPLY 1
Anonymous
Not applicable

I believe you should replace ALL with ALLSELECTED and reference your Version column in the ALLSELECTED statement.

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