Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
etane
Resolver I
Resolver I

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:

etane_0-1722386060760.png

And, if I filter for March thru May, average should yield 2.33:

etane_1-1722386134954.png

Here's a link to a simple data model:
Link

Thanks.

1 ACCEPTED SOLUTION
Ritaf1983
Super User
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+1
 RETURN
divide (DISTINCTCOUNT(Stores[Stores]),months)
Result:
Ritaf1983_0-1722389622430.png

 

Ritaf1983_1-1722389905607.png

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

2 REPLIES 2
etane
Resolver I
Resolver I

Thanks @Ritaf1983

Your logic is sound.  My actual model has activity across multiple years, products and status.  With you help, I was able to come up with a dax that suits my model.... something like this:

etane_1-1722458723473.png

 



 

 



Ritaf1983
Super User
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+1
 RETURN
divide (DISTINCTCOUNT(Stores[Stores]),months)
Result:
Ritaf1983_0-1722389622430.png

 

Ritaf1983_1-1722389905607.png

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors