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
delphinecarnet
Frequent Visitor

Number of days in month with multiple month selection

Dear PowerBI Community,

 

I'm attempting to create a MEASURE to calcultate the number of days in month. 

The DAX formula works fine for a single month, but when I add another month from the filter, the formula return blank

I've tried a few combinations here but I'm at a loss.

 

Thanks for all your help!

 

 

 

 

DaysinMonth = DAY( EOMONTH(SELECTEDVALUE(DATA[DATE1] ), 0 ))

 

 

 

delphinecarnet_0-1687357002317.png

 

3 REPLIES 3
Alf94
Solution Supplier
Solution Supplier

Hi @delphinecarnet ,

 

What is your expected output? Total number of days? Average number of days? Minimum? Maximum? We need to know to help you 🙂

 

Best,

Thanks for your reply!

 

In this case, I'm expecting 61 which is March + April.

On the left when only April is selected, it does return the correct number of days in the month which is 30 but when I choose an extra month it return blank.

@delphinecarnet,

 

From what I see, you do not have a date table in your model. I would suggest you to first create one, then use the following measure:

 

DaysinMonth = COUNTROWS( DateTable )

 

Alf94_1-1687360916902.pngAlf94_2-1687360959200.png

 

If I answered your question, please mark my post as a solution.

 

Best,

 

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