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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Unmona_D
Helper I
Helper I

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

@Unmona_D , Try like

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

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Unmona_D ,

 

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

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?

@Unmona_D , Try like

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

Mariusz
Community Champion
Community Champion

Hi @Unmona_D 

 

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

 

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.