Forum Discussion
Previous Month only Blank
- 5 years ago
The reason I asked because in your sample data one of the numbers (43) has the most recent data up to Oct, the rest is up to Nov and that was the reason for this question. Anyhow here is the measure for the previous month:
Previous month Count = VAR __currentDate = EOMONTH ( MAX ( Sheet1[date] ), -1 ) RETURN CALCULATE ( COUNTROWS ( Sheet1 ), DATESBETWEEN ( Sheet1[date], EOMONTH ( __currentDate, -1 ) + 1, __currentDate ) )Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Anonymous so you will select a month to compare, correct? if there is no month selected, should it return blank() or use the current month. You have to think thru this and explain all of it. I don't like half baked solutions.
I have created 2 measures:
Current Month - provides total count for each value in a column for the current month
previous month - provides total count for each value in a column for the directly preceeding month
Difference: Current month - previous month
Currently the [previous month] measure is just returning the exact same results as if I want to count from the beginning to the end period. That shouldnt be what it does.