Forum Discussion

Raggsokk's avatar
Raggsokk
Frequent Visitor
3 years ago
Solved

Weekly RVtools report - add colour

I find many post on how to add colour to reports, but I can't really wrap my head around it on how I can do it in my dataset. Hopefully someone can point me in the right directions. I have made a...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  Raggsokk ,

     

    Here are the steps you can follow:

    1. Create measure.

     

    Flag =
    var _select=
    SELECTEDVALUE('Table'[Date])
    var _current=
    SUMX(
        FILTER(ALL('Table'),
        WEEKNUM(_select,2)=WEEKNUM('Table'[Date],2)&&'Table'[Server]=MAX('Table'[Server])),[RamGB])
    var _last=
    SUMX(
        FILTER(ALL('Table'),
        WEEKNUM(_select,2)-1=WEEKNUM('Table'[Date],2)&&'Table'[Server]=MAX('Table'[Server])),[RamGB])
    return
    SWITCH(
        TRUE(),
            _last>_current,"red",
            _last=_current,"yellow",
            "blue")

     

    2. Conditional formatting – Background color.

    3. Result:

     

    Best Regards,

    Liu Yang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly