Forum Discussion

f1rich's avatar
f1rich
Frequent Visitor
3 years ago
Solved

switch measure dax

Hi, hope you help me.    I am struggling to get the Switch measure to work, am I missing something?  What i want to show is if date less than 18/10/22 and measure = Sheffield then 440 but if date ...
  • f1rich's avatar
    f1rich
    3 years ago

    Hi, 

     

    I have finally done it. Don't know why but it works

     

    What i did was duplicate my date (DD/MM/YYYY hh:mm:ss) column and covert it into Date Only (DD/MM/YYYY)

     

    Below is my formula

     

    Mins in a day = SWITCH(TRUE(),
    SELECTEDVALUE('Measure Selection'[Measure Name])="Sheffield" && SELECTEDVALUE(Date[Date_Only])<DATE(2022, 10, 18), 440,
    SELECTEDVALUE('Measure Selection'[Measure Name])="Sheffield" && SELECTEDVALUE(Date[Date_Only])>=DATE(2022, 10, 18), 600,
    1440
    )