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

Tracking year by year changes

Hi all

I have a simple line graph that is looking at an average premium amount per month for the last 48 calender months (01/07/2018 - 30/06/2022)

HB13_1-1658819440039.png

 

 

I now need to create a second visual that tracks the year on year change in the average monthly premium. For example,
((June 2022 avg prem) / (June 2021 avg prem)) - 1

I don't know how to achieve this in a measure, hoping someone can assist.

 

Many thanks!

 

4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

Hi @HB13 ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-jianboli-msft
Community Support
Community Support

Hi @HB13 ,

 

Please try:

Add a new column to calculate the changes:

Column =

var _a =CALCULATE(MAX('Table'[Value]),FILTER('Table',YEAR([Date])=YEAR(EARLIER('Table'[Date]))-1&&MONTH([Date])=MONTH(EARLIER('Table'[Date]))))

return IF(ISBLANK(_a),BLANK(),CALCULATE(MAX('Table'[Value]),FILTER('Table',[Date]=EARLIER('Table'[Date])))/ _a-1)

Then create a date table and create relationship between the two tables:

vjianbolimsft_0-1659092786735.png

 

Apply date and the column to the line chart:

vjianbolimsft_1-1659092786737.png

 

Final output:

vjianbolimsft_2-1659092786738.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@HB13 , Create a date table, Join with date of your date table, create MOM measure like the below examples and use that on secondary line axis

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

diff = [MTD Sales]-[last MTD Sales]
diff % = divide([MTD Sales]-[last MTD Sales],[last MTD Sales])

 

 

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

Thank you for your response, much appreciated 😄
This helps with month on month changes but I need to calculate a Year on Year change for the (last 48) months that are being filtered for

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.