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! Request now

Reply
JMAlloway
Helper I
Helper I

Slicer interfering with measure

I have a simple measure, as shown below, that calculates the number of months passed YTD. This measure feeds into an annualized figure. My issue is that a slicer that is used is messing up the calculation. I need to adjust this formula to omit any slicer input from its calcuation. I tried the All() function with no luck.

 

 

 

MonthsPassed = CALCULATE ( COUNTROWS ( SUMMARIZE ( 'Master Sheet', Dates[Month Year] ) ), DATESYTD ( Dates[Date] ))

 

 

 

1 ACCEPTED SOLUTION

@JMAlloway ,

 

That you can get like

month(date(year(today()), month(today())-1,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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@JMAlloway , Try like

 

MonthsPassed = CALCULATE ( distinctcount( Dates[Month Year] ) , DATESYTD ( Dates[Date]))

or add column from fact to check null
MonthsPassed = CALCULATE ( distinctcount( Dates[Month Year] ) , DATESYTD ( Dates[Date]), filter('Master Sheet',not(isblank('Master Sheet'[Date] ) )))

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

Unfortunatly, the first suggestion yields the vallue '12' and the second suggestion yields the value '5'. At the end of the day, all I need is a measure that gives me the number '8' (if the current month is September) or '9' (if the month is October), etc.

@JMAlloway ,

 

That you can get like

month(date(year(today()), month(today())-1,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

Thanks @amitchandak! That solves my issue.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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