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

Calculate days in selected month in slicer

Hello, 

I want to build a measure to calculate the days in the selected month. Please help.

 

Unmona_D_0-1596012373992.png

 

1 ACCEPTED SOLUTION

@Anonymous , Try like

day(eomonth(maxx(allselected(Table), Table[Start Date]),0))

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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous ,

 

In case it coming from date calendar

1.  day(eomonth(maxx(allselected(Date), Date[Date]),0))

2. Count(Date[date])

 

In case this month without a date. we need to additional coding

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

Hi Amit,

 

Thank you. But this doesnt come from a date calendar. It is start of each month. Hence, the issue. Is there a way that the measure calculates the number of days based on the slicer input?

@Anonymous , Try like

day(eomonth(maxx(allselected(Table), Table[Start Date]),0))

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
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

 

Just count rows of your date table like: COUNTROWS( dates ) 

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

Thank you Mariusz. But the issue is this doesnt come from a uniform date calendar (with all dates included for a month)

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