Forum Discussion
Anonymous
7 years agoNot applicable
Variance For Specific Date Range Based on Flag (DAX)
Hi all,
I have some sample data below.
I want to create a calculated column that displays the variance of "PctComplete" for the previous 2 weeks of a date marked as "IsTrue". The values not marked as "IsTrue" will be BLANK.
I tried to do this, but got NaN values in my rows with "IsTrue = 1". I do have my date keys connected to a date dimension.
Var2WkBefore = IF(Example[IsTrue] = 1, CALCULATE(VARX.S(Example, Example[PctComplete]), DATESBETWEEN(DimDate[DayDate], RELATED(DimDate[DayDate]) - 14, RELATED(DimDate[DayDate]))), BLANK())
Any help is greatly appreciated. I also have many stores and multiple IsTrue dates, but I figured that if I can do it for one, it will work for all.
Anonymous
Try to set the relationship to One-to-One (1:1).
1 Reply
- v-chuncz-msftCommunity Support
Anonymous
Try to set the relationship to One-to-One (1:1).