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

Ignore filter year selection

Hello everyone,

 

Iam trying to ignore the selection of an certain year.

 

I've the following measure:

 

Grow Year -1 = CALCULATE(SUM('Inscrições'[Value]);FILTER('Inscrições';and(not('Inscrições'[Pais]="Portugal");'Inscrições'[Ano]=max('Inscrições'[Ano])-1)))

 

I think that should work, bue when i change of year, the figure become empty (on this case table im using a table).

 

I hope you guys can help me !

 

Thanks !

1 ACCEPTED SOLUTION
SqlJason
Memorable Member
Memorable Member

Alright, I think I understood you now. What you want is to show the previous year no matter what year is selected. For eg, if we are on 2016, you always want to show 2015 data, even if we select 2010 or 2012 or any other year on filter.

 

1) Create a measure that will show the max year available in the fact table

MaxYear=CALCULATE(MAX('Fact'[Year]), ALL('Fact'[Year]))

 

2) Now make the measure as you want. Instead of hardcoding 2014, you can use the measure which will always return the max year available in fact, irrespective of the filter.

test=CALCULATE(SUM('Fact'[Sales]), FILTER(ALL('Fact'[Year]), 'Fact'[Year]=[MaxYear]-1))

 

Is this what you want? 🙂

View solution in original post

10 REPLIES 10

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.