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

Measure current year (context) minus last year KPI

Hello,

 

I have a years dimension table and I want to calculate a KPI wich is the difference between the value of an another KPI value in a year minus its value the year before:

KPI2 = KPI1(YearN) - KPI(YearN-1)

 

Any help how to do it?

 

Thank you

1 ACCEPTED SOLUTION
vivran22
Community Champion
Community Champion

Hello @Wattar ,

 

You may use Time Intelligence DAX for this: PARALLELPERIOD or DATEADD

 

KPI 2 = 
VAR KPI1 = [measure]

VAR KPI1PrevYear = 
  CALCULATE([measure], PARALLELPERIOD([date],-1,"Year"))

VAR Diff = KPI1 - KPI1PrevYear

RETURN

Diff

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

View solution in original post

2 REPLIES 2
vivran22
Community Champion
Community Champion

Hello @Wattar ,

 

You may use Time Intelligence DAX for this: PARALLELPERIOD or DATEADD

 

KPI 2 = 
VAR KPI1 = [measure]

VAR KPI1PrevYear = 
  CALCULATE([measure], PARALLELPERIOD([date],-1,"Year"))

VAR Diff = KPI1 - KPI1PrevYear

RETURN

Diff

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

It works just fine. Thank you @vivran22 

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