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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
aayush_a
New Member

KPI using a specific year as a trend

Hey, 

 

I am trying to create a KPI card on my dashboard and want my reference year (within the trend field) to always compare my current year to 2019 sales. So whatever year I filter my dashboard by, it should always compare my sales to 2019. 

 

Right now, I have it set as 

Revenue Period 2019 = CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(filter_date[Date], -3, YEAR))

This works when I set my filters to the year 2022 and it compares it to 2019, but when I change by filter to 2021, it begins comparing to the 2018 period. 

 

I also tried this method, 

Revenue Period 2019 = 
var _diff = 2019 - maxx(allselected('Date'), 'filter_date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(filter_date[Date], _diff, YEAR))

But this doesn't work for me either. 

 

Any help on this will be very appreciated. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@aayush_a , Also use date from date table in the measure

 

Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(Date[Date], -3, YEAR))

 

or

 

Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), dateadd(Date[Date], -3, YEAR))

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

1 REPLY 1
amitchandak
Super User
Super User

@aayush_a , Also use date from date table in the measure

 

Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), PARALLELPERIOD(Date[Date], -3, YEAR))

 

or

 

Revenue Period 2019 =
var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )
return
CALCULATE((SUM(transactions[Total]) - SUM(transactions[Total_Tax])), dateadd(Date[Date], -3, YEAR))

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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