Forum Discussion
Justas4478
4 years agoPost Prodigy
Category with specific dates
Hello I am trying to create a measure that checks weeks left to refresh for specific category in Level5 column. This is the table. This is Weeks to refresh measure. I am trying to modify...
- 4 years ago
Ah, OK. Try something like
Weeks to refresh = var currentCategory = SELECTEDVALUE('Table'[Category 5]) var refreshDate = SWITCH( currentCategory, "Open", DATE(2022, 7, 25), "Female", DATE(2022, 6, 20) ) return DATEDIFF( TODAY()-1, refreshDate, WEEK)
Justas4478
4 years agoPost Prodigy
Due to Live connection method I am only able to use measures. I cant use calculated columns or create tables.
johnt75
4 years agoSuper User
Ah, OK. Try something like
Weeks to refresh =
var currentCategory = SELECTEDVALUE('Table'[Category 5])
var refreshDate = SWITCH( currentCategory,
"Open", DATE(2022, 7, 25),
"Female", DATE(2022, 6, 20)
)
return DATEDIFF( TODAY()-1, refreshDate, WEEK)