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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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))

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] ) )))

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))

Thanks @amitchandak! That solves my issue.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.