Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

conditional formatting by field

Hello!  I am relatively new to DAX and need some assistance on an issue....   I have a matrix I want to turn the entire column either red or green depending on the following parameters: If the tim...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Anonymous I am not sure if I got your first message, but I am providing a solution for your second message.  If you need more help please post a power bi file so its a little easier to understand.

     

    Try writing a switch. I am just writing a bit of the code, I am sure you can add the required values.

     

    VAR TimeHour = HOUR(DATETIME Field you are using to extract time by hour text)
    RETURN SWITCH(TRUE(),
                  TimeHour IN {4,5,6,7,8} && Sum(Journal[Quantity]) <= 139, 1,
                  TimeHour  = 9 && Sum(Journal[Quantity]) <= 104, 1
                  TimeHour IN {10,11} && Sum(Journal[Quantity]) <= 139, 1,,
                  2)