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
itchyeyeballs
Impactful Individual
Impactful Individual

Percentage difference Previous Year - No dates

Hi All,

 

I'm trying to create measures to calculate year on year % difference. (should be simple but its Friday Smiley Happy)

 

As it stands my data does not have dates, just a year identifier i.e. "14/15","15/16"

 

I have a lookup table for the year identifier with a sort order column that has an integer number for each year so I can sort correctly. I was hoping to just use the sort order column to identify previous year ([sort_order] - 1) but running into trouble.

 

Is it possible to use calculate to sum values for previous year identifier? I'm not sure the time inteligence fiunctions will work for me as my data doesn't have real dates and I don't really want to have to create spurious ones.

1 ACCEPTED SOLUTION

Got there in the end (funny how typing something out gets you to think)

 

Changed the formula to: 

 

Calculate(SUM(Profile[I_FTE]),previousyear('Calendar'[End Date],"August 31"),all('Calendar'))

 

and fixed the link that broke when I reimported my lookup table and hey presto

 

View solution in original post

2 REPLIES 2
itchyeyeballs
Impactful Individual
Impactful Individual

I have now added start date and end date fields to my lookup so there is a notional real date attached to my data, however the measure is blank when retrned in a matrix.

 

Code used is:

 

Calculate(SUM(Profile[I_FTE]),previousyear('Calendar'[End Date],"August 31"))

 

'Calendar'[End Date] is a date/time field

 

SUM(Profile[I_FTE]) works on its own

 

Any ideas?

Got there in the end (funny how typing something out gets you to think)

 

Changed the formula to: 

 

Calculate(SUM(Profile[I_FTE]),previousyear('Calendar'[End Date],"August 31"),all('Calendar'))

 

and fixed the link that broke when I reimported my lookup table and hey presto

 

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.