Forum Discussion
Measure not displaying full amount
Hi,
I am trying to display the number of weekdays for each month but the selecting filter is not working
In the screenshot below, when I select Apr, it correctly shows the April numbers, but when not selecting any month, it does not show the sum of days from Jan-Jun
The measure I am using to find the "Count Weekday" is :
Sarah
Hi Anonymous ,
You could create a measure to get the slicer status. If the result returns blank, you could make it return the sum of all months.
Measure = VAR a = SELECTEDVALUE ( 'Slicer'[Month] ) RETURN IF ( ISBLANK ( a ), SUMX ( ALLSELECTED ( 'Table'[Month] ), [Count Weekday Official] ), [Count Weekday Official] )
6 Replies
- nvprasad
Solution Sage
Hi,
Can you try below measure to calculate count of week days?
Weekday_Check =
CALCULATE (
COUNTROWS ( 'Table' ),
FILTER ( ALL ( 'Table'[Date] ), WEEKDAY ( 'Table'[Date], 2 ) < 6 )
)Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂Regards,
N V Durga Prasad - amitchandak
Super User
Anonymous , you can create a workday column in date table and sum it up
Workday= if(WEEKDAY([Date],2)<6,1,0)
- aj1973
Community Champion
Hi Anonymous
In your date Table create a Column for the workdays
WorkingDay_Mark =VAR WeekDayNum =WEEKDAY ( DimDate[Date] )RETURN(IF ( WeekDayNum = 1 || WeekDayNum = 7 ,0,1))the use a slicer for the dates and a Card for your weekdaysRegards- AnonymousNot applicable
thank you, all!
but my main question is how to get the correct total number of days between jan and jun if no dates are selected in my filter
Thank you!
Sarah- aj1973
Community Champion
Anonymous
Change the date slicer to view it 'Between' or 'relative dates'
- v-eachen-msft
Community Support
Hi Anonymous ,
You could create a measure to get the slicer status. If the result returns blank, you could make it return the sum of all months.
Measure = VAR a = SELECTEDVALUE ( 'Slicer'[Month] ) RETURN IF ( ISBLANK ( a ), SUMX ( ALLSELECTED ( 'Table'[Month] ), [Count Weekday Official] ), [Count Weekday Official] )