Forum Discussion
Bare
6 years agoFrequent Visitor
DAX measure to get first value dynamically with different time period windows
Hi All, I need your help. I have researched possible solutions on this forum & the wider net, but couldn't find what I'm looking for. Much appreciate any help, pointer, assistance! Scenario: I have...
parry2k
Super User
6 years agoBare one thing is not clear what define the 7 day period. Mon - Sun, sun to mon or something else?
Bare
6 years agoFrequent Visitor
Hi parry2k
Thanks for having a look.
I define Mon as 1, Sun as 7 per default. In praticse, the time window will be longer in years: 1, 3, & 5 yrs. I used here days for illustrative purposes only.
I've simply left the definition of the time period to the DATEADD function. Hence in the DAX code, I have used a 'nonblank' VAR to get the first non blank date if at the end of DATEADD we have a weekend.
I hope this helps and answers your question