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
brian0782
Helper II
Helper II

Use max slicer value to filter another table

Hi

 

I have a slicer where I'd like to use the max value to filter another table:

 

Year of Account = FILTER((AccountYear), VALUE(AccountYear[yoa_code]) <= CALCULATE(MAX(Period[period_year])))

 

However the table is not being filtered - I'm expecting 2024 to appear as 2020:

 

brian0782_0-1606148609517.png

 

Hard-coding the value gives me the desired result:

 

brian0782_1-1606148643353.png

 

Can someone advise wher I'm going wrong please?

 

Thanks

 

Brian

 

4 REPLIES 4
brian0782
Helper II
Helper II

Hi @Pragati11 

 

I have data up to 2019 but want to show all columns upto the Period Year in my table - even if there is no data. If I hard-code the value 2020 into the Year of Account, I get the desired result:

 

brian0782_0-1606152534440.png

 

 

Also @Pragati11, Year of Account is a calculated table:

 

brian0782_0-1606153959042.png

 

 

 

 

 

 

 

 

brian0782
Helper II
Helper II

Hi @Pragati11 

 

I've created the following measure:

 

Max Period Year = CALCULATE(MAX(Period[period_year]), ALL(Period))

 

and used it here:

Year of Account = FILTER((AccountYear), VALUE(AccountYear[yoa_code]) <= Period[Max Period Year])

 

However, I'm still seeing 2024 rather than 2020:

 

brian0782_0-1606152090465.png

 

 

 

Hi @brian0782 ,

 

What all date range data you have in your data?

Is that you have data till 2024 but want to show only till 2020 in the slicer?

 

Also in your slicer you have got a different field moved. See below:

Pragati11_0-1606152448833.png

You should move the new calculation in your slicer "Year of Account".

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Pragati11
Super User
Super User

Hi @brian0782 ,

 

Create a measure for your maximum period year as follows:

Max Period Year = CALCULATE(MAX(Period[period_year]), ALL(Period))

 

Now use this measure in place of "CALCULATE(MAX(Period[period_year]))" in your DAX expression for Year of Account.

 

Let me know if this works.

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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