Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
lauralovesBI
Frequent Visitor

Remove page slicer from specific measure, same measure to show prior year of slicer year instead

Perhaps not possible but fingers crossed!

 

My calendar is non standard and based on fiscal year (dax time measures wont work). I have a matrix where I want to show selected year sales (from slicer choice) vs prior year sales.

 

This is the measure for current selected year (this works):

CY Sales = 

VAr SelYear = MAX(Calendar[Fiscal Year])
Return
IF(Data[Sales]<> BLANK(),CALCULATE(Data[Sales],FILTER(Calendar,Calendar[Fiscal Year]=SelYear)))
 
However, I am stuck at the measure to show prior year of selected slicer year. I have removed the slicer using ALL but now I want to add back in the selected year minus 1. Doing this below shows all fiscal years totalled. What am I missing?
PY Sales = CALCULATE(Data[Sales],filter(ALL(Calendar[Fiscal Year]), Calendar[Fiscal Year]-1))

 

Thank you in advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@lauralovesBI , we create a fiscal year in the calendar like a number or rank 

 

Assuming you have year start date or FY (sortable)

Column in date table

Year Rank = RANKX(all('Date'),'Date'[Year Start date],,ASC,Dense)

 

 

Measures // but these are at year level
This Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),h'Date'[Year Rank]=max('Date'[Year Rank])))
Last Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@lauralovesBI , we create a fiscal year in the calendar like a number or rank 

 

Assuming you have year start date or FY (sortable)

Column in date table

Year Rank = RANKX(all('Date'),'Date'[Year Start date],,ASC,Dense)

 

 

Measures // but these are at year level
This Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),h'Date'[Year Rank]=max('Date'[Year Rank])))
Last Year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This worked beautifully! You are a rock star! Thank you!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.