Forum Discussion
Anonymous
5 years agoNot applicable
Problem with DATESINPERIOD function
Hello, I have a table of self reports of COVID symptoms which contatins user ID (AccountName) and the date of the report. I'm trying to create a function which sums the unique reports over th...
- 5 years ago
Hey Anonymous ,
you can use this DAX statement instead:
Reports_Lst2Wks_ALT = var _today = TODAY() var _7DaysBeforeToday = _today -7 return CALCULATE( DISTINCTCOUNT(selfreports[AccountName]) ,DATESBETWEEN(selfreports[Date] , _7DaysBeforeToday , _today) )DATESINPERIOD requires a dedicated date table without gaps, for this I recommend following the link Greg_Deckler provided in his post.
Hopefully, this helps to tackle your challenge.
Regards,
Tom
Greg_Deckler
5 years agoCommunity Champion
Anonymous - See if this helps you better understand DATESINPERIOD - https://community.powerbi.com/t5/Quick-Measures-Gallery/To-bleep-With-DATEADD/m-p/1259467#M583