Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I'm trying to figure out way to calculate a month over month % based on this data (ln_count). However I don't want to use the actual month value because of the limitations with filtering and date hierarchy.
Instead i have an integer that uniquely represents the month & year (month_name_int)
Anyone know the DAX code to do this ?
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated column.
Column =
var _group=CALCULATE(SUM('Table'[In_count]),FILTER(ALL('Table'),'Table'[month_name_int]=EARLIER('Table'[month_name_int])))
var _all=SUM('Table'[In_count])
return
DIVIDE(_group,_all)
2. Result:
Does this meet your expected result? If it does not, you can display the result in the form of an icon, and we will better solve the problem for you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
Here are the steps you can follow:
1. Create calculated column.
Column =
var _group=CALCULATE(SUM('Table'[In_count]),FILTER(ALL('Table'),'Table'[month_name_int]=EARLIER('Table'[month_name_int])))
var _all=SUM('Table'[In_count])
return
DIVIDE(_group,_all)
2. Result:
Does this meet your expected result? If it does not, you can display the result in the form of an icon, and we will better solve the problem for you.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
If using month then you can use PREVIOUSMONTH(), but in your case, I suspect you can utilize EARLIER() function.
I think this solution will get you most of the way there: https://community.powerbi.com/t5/Desktop/Referencing-a-previous-Row/m-p/477748
Then all you need to do is calculate the percentage from that value you just looked up, something like:
Percentage of Previous Month = DIVIDE(In_count,ln_count_LM,0)
That zero at the end means that if last month column is blank or zero, it will just return 0 instead of an error.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
89 | |
86 | |
82 | |
64 | |
49 |
User | Count |
---|---|
125 | |
111 | |
88 | |
69 | |
66 |