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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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