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

See variance with previous year based on selections

This is the situation:

rpinxt_0-1713964696915.png

So I have a matrix where I now have selected (slicers not in picture) years 2023 and 2024. LBE1 and LBE2.

Addendum is the value (measure) of the matrix.

 

What I am trying to do it to make a measure variance (var) which for instance takes 2024 LBE2 and subtracts 2023 LBE2.

Did not succeed so I tried first getting the value of the year before.

But as you can see it only gives me the total.

 

Is there a way to get what I want?

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@rpinxt , previousyear will the full value of last year, use sameperiodlastyear

 

example

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@rpinxt , previousyear will the full value of last year, use sameperiodlastyear

 

example

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

rpinxt
Impactful Individual
Impactful Individual

Ah thanks @amitchandak for pointing that out!

Makes sence that previousyear would be full year.

Thanks for pointing me to the sameperiodlastyear measure!

Works like a charm.

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.