Forum Discussion
Date table DAX Help
Hi All,
I have a an attendance table which is tied to a date table. Issue I am having is there isnt data for every single day. I want the 0 days to count e.g.
Mon - 0%
Tue - 0%
Wed - 7%
Thu - 0%
Fri - 0%
The calculation I am trying to do would be 0+0+7+0+0 = 7 divided by 5 = 1 (rounded up)
How do I edit this to include 0 days? The highlighted is the only day in that week that had attendance
10 Replies
- MikelyticsResident Rockstar
Hi Anonymous
Please try putting "+0" behind your formula
AVG % (M-F) = VAR WeekdayTable = FILTER(dDates, dDates[DayOfWeek] <> 6 && dDates[DayOfWeek] <> 0 && dDates[Year] = 2022) RETURN AVERAGEX(WeekdayTable, [DailyAttendance]) + 0Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
- AnonymousNot applicable
Hey,
That adds 0 at the Year level not the day level
- MikelyticsResident Rockstar
ok, I have overseen something. Can you please try the following:
AVG % (M-F) = VAR WeekdayTable = FILTER(dDates, dDates[DayOfWeek] <> 6 && dDates[DayOfWeek] <> 0 && dDates[Year] = 2022) RETURN AVERAGEX(WeekdayTable, [DailyAttendance] + 0)Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.