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
Anonymous
Not applicable

Divide a measure by the number of days that are filtered

Hi there, 

 

I have a measure which I would like to divide the sum of by the number of days that have been selected on the filter. 

 

As an example, I have the selected the last 18 calender months on my filter whilst filtering total revenue and I am looking to filter the revenue by the 547.50

 

Any help would be appreciated.  

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , a measure like

new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
Divide( sum(Table[Value]),datediff( _min ,_max,day)+1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hey Amita, I used Divide(Measure, COUNTROWS(Calender)) 

 

And it seems to have worked. 

 

Can you see any issues with using this?

 

Best, 

Anonymous
Not applicable

Hi @Anonymous ,

 

That should work if it is a standard calendar.

You could also consider if there are duplicate values or missing dates in the calendar table depending on your needs.

 

Best Regards,

Jay

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.