Forum Discussion
dianate12
3 years agoFrequent Visitor
DAX
I have year 2023 and 2024 and weeks 1-52.but in week 37 i don't have values for year 2023 and for week 37 i have values for year 2024 but when i write dax im getting 36 th week values for 37 th week ...
SamInogic
Super User
2 years agoHi dianate12 ,
It seems that facing issue with DAX giving incorrect values when you have missing data for specific weeks in different years.
Try modifying your DAX as below,
IF (
SELECTEDVALUE('TEBIT analysis'[Variation]) IN {"New", "Approved", "Cancelled", "Start Date Change (Postponed)", "Start Date Change (Preponed)"},
SUM('TEBIT analysis'[Savings]),
IF (
ISINSCOPE('TEBIT analysis'[Current Tyco Week Id]),
CALCULATE (
SUM('TEBIT analysis'[Savings]),
FILTER (
ALL('TEBIT analysis'[Current Tyco Week Id]),
'TEBIT analysis'[Current Tyco Week Id] = MAX('TEBIT analysis'[Current Tyco Week Id])
)
)
)
)
Thanks!