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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.