Forum Discussion

Slaper's avatar
Slaper
Frequent Visitor
2 years ago
Solved

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...
  • Slaper's avatar
    Slaper
    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))