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
TommiL
Regular Visitor

Trend for last three months

Hi 

I am very new to Power BI and maybe I am having troubles understanding how it behaves.

I have below table were a have my monthYear and I have a summarized price. Then I have a third coloumn with a measure were I calculate a percentage for the price compared to a total.

 

Percent = SUM('Report'[Price] )/Sum('Report'[Pris total antal])*100

 
I would like to see the trend(average) of Sum of Price for the last three months, but I can not figure out how it is done. I have watched a lot of youtube videos and also searched this community, but have not hd the skills to make it work.
 
My logic would say that is should be pretty easy, and it should just summarize march, april and may and divide it by the total price of those months.
What is it that I should do to make this work. 
I am using a calender table.

percentage.jpg      perecent_trend.jpg

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@TommiL ,

You can try a measure like

Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

Rolling 3 before 2 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],eomonth(MAX('Date'[Date ]),-1),-3,MONTH))

Thank you for the very quick reply.

I have tried that exact formula, but it seems more like it is summarizing instead of the average, so I can divide it by 3 so I have the average that could work. 

 

But to make it more user friendly I have done the same measure on the Totalprice. Then I would like to have 3_Months_Price as a percentage of 3_months_totalPris. This I can't figure out as well. It doesn't seem possible to do as the other Percent I did. 

I guess method are different when it want to do calculation of measures?

 

TommiL_2-1643287906116.png

 

 

 

 

 

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.