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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
wildmight2017
Advocate II
Advocate II

Daily Average and Relative Month filter problem

Good morning,

 

I have the following issue. I'm trying to create a very basic measure.

 

Avg Daily Sales = DIVIDE (SUM(Sales), DISTINCTCOUNT(Date[Date]) ) 

 

Works as expected, but when using a Relative Filter ( Date = This Month)  - the count of dates switches to 31 for August, hence the issue in formula. Using  a combination of CALCULATE and FILTER, such as CALCULATE(DISTINCTCOUNT(Date[Date]), FILTER(ALLSELECTED(Date[Date]), Date[Date]<TODAY() ) , I can solve this for the current month's measure, however, the formula stops working correctly for a filter with Previous 3 / 6 / etc. months - because it aggregates the count of dates for the whole period (181 days for 6 months). 

 

Is there an elegant solution that would avoid me having to spell out 2 measure for different tables? 

 

Thank you

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @wildmight2017

Do you have values in Sales after today?

I test on my site, If my Sales is not 0 after today, when I use your first measure and select a Relative Filter ( Date = This Month), It would calculate dates until 31 August.

 

Best Regards

Maggie

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @wildmight2017

Do you have values in Sales after today?

I test on my site, If my Sales is not 0 after today, when I use your first measure and select a Relative Filter ( Date = This Month), It would calculate dates until 31 August.

 

Best Regards

Maggie

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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