Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Conditional formatting based on multiple conditions in Pivoted Data

Hi , Currently working on a conditional formatting logic , but stuck with the same to have the conditional formatting on Profit Colum with multiple conditions in a Pivoted Data Requirement :-  App...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous 

    I changed to your measure to the following, then it can work, you can refer it.

    Measure =
    VAR a =
        SELECTEDVALUE ( 'Table'[Attribute] )
    VAR B =
        SELECTEDVALUE ( 'Table'[Value] )
    VAR C =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Attribute] = "Actual"
                    && [Area] IN VALUES ( 'Table'[Area] )
            )
        )
    VAR D =
        CALCULATE (
            SUM ( 'Table'[Value] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                'Table'[Attribute] = "Target"
                    && [Area] IN VALUES ( 'Table'[Area] )
            )
        )
    RETURN
        SWITCH (
            TRUE (),
            a = "Profit%"
                && C = 0, "Red",
            a = "Profit%"
                && D = 0, "Orange"
        )
    

     

    Best Regards!

    Yolo Zhu

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