Forum Discussion

NewbieJono's avatar
NewbieJono
Post Partisan
5 years ago
Solved

default filter date, Switch statement

Hello i have the follwoing code to identify today.   Is Today = Switch(True(), [Date] = Today(), "Today", Format([Date], "DD/MM/YYYY"))   is there a method to identify last working day. i do ha...
  • amitchandak's avatar
    5 years ago

    NewbieJono , Try two columns like

     

    WorkingDay = if(WEEKDAY([Date],2) >=6,0,1)

    Is Today =
    var _max = maxx(filter('Date', 'Date'[Date] <=today() && [WorkingDay] =1),'Date'[Date])
    return
    Switch(True(),
    [Date] = _max, "Today",
    Format([Date], "DD/MM/YYYY"))