Forum Discussion
timothyh
4 years agoRegular Visitor
Adding month over month % difference column to table
Hi, New to Power BI so I may be missing an easy solutions to this issue. I need to create a column in my table showing the month over month difference by percentage. I believe I need to add a new...
v-xiaotang
4 years agoCommunity Support
Hi timothyh
You can try this, create the column below
Difference =
var _preMY= CALCULATE(MAX('Table'[Month/Year]),FILTER(ALL('Table'),'Table'[Month/Year]<EARLIER('Table'[Month/Year])))
var _cur= 'Table'[Sessions]
var _pre= CALCULATE(MAX('Table'[Sessions]),FILTER(ALL('Table'),'Table'[Month/Year]=_preMY))
return divide(_cur-_pre,_pre)
result
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
timothyh
4 years agoRegular Visitor
Thank you for the reply. I'm probably missing something but when I try to create a new column in my data for Difference, then add the formula you suggested, the formula does not work. It doesn't recognize 'Table.' What I'm trying to do is show the difference month over month for each column in my report. Add a column next to Sessions showing the difference from 202204 to 202205, etc. Column would be the % difference from 202204 to 202205. Same with the Pageviews column.