Forum Discussion
Slaper
2 years agoFrequent Visitor
Create a table based on a date
I have the following problem. Create a measure : NewTableLastDate = var Find =SWITCH( WEEKDAY(TODAY(),2) ,1,today()-4 ,7,today()-3 ,6,today()-2 ,today()-1 ) Var compare = if( Find > ma...
- 2 years ago
I have found the solution,
TodayDat =
VAR Find =SWITCH(
WEEKDAY(NOW(),2)
,1,today()-4
,7,today()-3
,6,today()-2
,today()-1
)
VAR Compare=if(
Find > max('tbl'[Dates])
,max('tbl'[Dates])
,Find
)
RETURN
CALCULATETABLE (
FILTER ( tbl, 'tbl'[Dates]=Compare))
Greg_Deckler
2 years agoCommunity Champion
Slaper You can't use measures like that. Measures are for use at the reporting level.