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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Vladracs
Helper I
Helper I

Newbie need help with Variance

Hello Experts,

 

I am still struggling with basics concepts in PBI, hopefully you can enlight me a bit.

I have a big table that I divided into a couple of dim tables (customers, variables) and a fact table with dates and Amount for the dates (1 per month, per customer, ver variable). 

I would like to visualize a table, where I can filter on a Customer basis and then filter on a fixed month and for 1 specific variable and get the Amount for the months in the different years.

 

And add a new column that shows the difference in Amount from one year to the next (having the lowest year as a base). 

 

You can see a (fict) sample below.

DateCustomerVariableAmount
Jan 2022AX1
Feb 2022AX2
...AX3
Dec 2022AX4
Jan 2021AY10
Feb 2021AY20
...AY30
Dec 2021AY40

 

Here with Variance Column, after filtering per customer and month and variable:

Filter (Jan, A, X):

DateCustomerVariableAmount Variance
2020AX1 
2021AX10
2022AX10099 

 

I know its a big ask. But if you could point me to the right direction Id be very thankful.

Regards,

Vladimir

 

1 ACCEPTED SOLUTION
VijayP
Super User
Super User

@Vladracs 

 

You have to use SAMEPERIODLASTYEAR Function to find yoy comparison the way you want!

https://www.youtube.com/watch?v=L6kbQi7Mvpk&list=PLWQB3PEUJKRneu8fam5CaCMCdrIdT_zDD&index=2

Watch at 7:52 to find the formula usage. I suggest watch 1 and 2 of the same playlist to understand the outcome much better




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


View solution in original post

4 REPLIES 4
VijayP
Super User
Super User

@Vladracs 

The video explains what exactly you want ! First go thru and try and you will get the result as you required.




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Hello VijayP,

Thx for the hint, I was able to get a column that shows the value of previous year, with
Last Year Value = CALCULATE (
Ranking[sum of values],
SAMEPERIODLASTYEAR ( 'Date'[Data] ) 
)

The problem is I probably didnt explain the requirement fully.

I would like to filter the table for 2 year and get the same result...

say I chose 2018 and 2020, or 2019 and 2022 , so its more previous value in the table (dynamicly sliced by the slicer in the page)...

I saw a solution that tried to index the rows and use Index - 1 to do the division...Problem is the same these indexes have to change as I slice the table...or this wont work as well. 😕

any further hints?

VijayP
Super User
Super User

@Vladracs 

 

You have to use SAMEPERIODLASTYEAR Function to find yoy comparison the way you want!

https://www.youtube.com/watch?v=L6kbQi7Mvpk&list=PLWQB3PEUJKRneu8fam5CaCMCdrIdT_zDD&index=2

Watch at 7:52 to find the formula usage. I suggest watch 1 and 2 of the same playlist to understand the outcome much better




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Thx for the link, very good stuff.

But the problem with most of the info I found so far , deals with values that are acummulating over time. These I am deal with are not. these are individual values. There's no total. So I am looking for some meausre that deals with individual values of each year (as per month/customer/variable). I havent a way to translate from the formulas/measures he uses to what I need 😞

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.