March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |