Forum Discussion
Running Average per Month with Month Filter
Hello.
I need a DAX for the requirement below:
I am trying to add a card to report. This card should calculate the running average of store openings per month. And, it should be filterable by the calendar. For example, without any filtering, I should see 20 store openings divided by 6 months to yield 3.33:
And, if I filter for March thru May, average should yield 2.33:
Here's a link to a simple data model:
Link
Thanks.
Hi etane
You can use dax:Average opend =var max_month = month(max('Stores'[Opened Date]))Var min_month = month(min('Stores'[Opened Date]))var months = max_month-min_month+1RETURNdivide (DISTINCTCOUNT(Stores[Stores]),months)Result:
the updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
2 Replies
- Ritaf1983
Super User
Hi etane
You can use dax:Average opend =var max_month = month(max('Stores'[Opened Date]))Var min_month = month(min('Stores'[Opened Date]))var months = max_month-min_month+1RETURNdivide (DISTINCTCOUNT(Stores[Stores]),months)Result:
the updated pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly