Forum Discussion
elkjoperik
7 years agoHelper II
IF filter value does not exist, then use other values
Hi! I have a problem I have not found any solutions to. I've made a dynamic this week vs last week metric; Sales PW = VAR CurrentWeek = SELECTEDVALUE(Date[Week Nr]) VAR CurrentYear = SELE...
- 7 years ago
Hi elkjoperik,
There is a solution. Please refer to the file in the attachment. You need to rebuild the model. It's hard to filter the proper data in the model in which all the data is stored in one table.
Solution = VAR lastweekTotal = CALCULATE ( SUM ( LW_DUMMY[Revenue FY] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[WeekNum] = MIN ( 'Calendar'[WeekNum] ) - 1 ) ) RETURN IF ( ISBLANK ( lastweekTotal ), CALCULATE ( SUM ( LW_DUMMY[Revenue FY] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[WeekNum] = MIN ( 'Calendar'[WeekNum] ) - 1 ), ALL ( Segments ) ), lastweekTotal )Best Regards,
Dale
v-jiascu-msft
7 years agoMicrosoft Employee
Hi elkjoperik,
Can you share a dummy sample? Then I can write down the DAX formula.
Best Regards,
Dale
elkjoperik
7 years agoHelper II
v-jiascu-msft found any solution?