Forum Discussion
mickjaeger
4 years agoHelper I
Count Consecutive Days Worked
Hi Everyone, I don't get to work in DAX often enough and am still a newbie when it comes to creating advanced measures with DAX. I have seen many, many proposed solutions out there for this sc...
Greg_Deckler
4 years agoCommunity Champion
mickjaeger This would have been my solution:
DaysWith02 =
VAR __CurrentDate = MAX('Date'[date])
VAR __CurrentHours = SUM('Hours'[roster_scheduled_time])
VAR __LastBlank = MAXX(FILTER(ALL('Hours'),'Hours'[date]<=__CurrentDate && [roster_scheduled_time] = BLANK()),'Hours'[date])
RETURN (__CurrentDate - __LastBlank) * 1.