Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Measure or Conditional formatting?

Hey All,

I have this type of a matrix in my PowerBI and I would like to find easily double, triple or more values in one row...

SKUtype1type2type3type4type5TOTAL
a1 1  2
b 1 3 4
c  1  1
d 2   2
f3  1 4

 

Do I need a specific dax formula? Or this can be done easily by some kind of formatting?

 

Example from above table:

SKU's "a", "b" and "f" should be my "red" as they have values in different columns, my correct/green would be SKU's "c" and "d" as the total matches value in the column.

 

Can I use different visual to easily see those problems?

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous ,

    I tried to use measure to solve your problem, since there is no option for conditional formatting for Rows in the matrix, I tried to make a color change to value, trying to achieve the same result, I was traversing it with COUNTAX, calculating whether it is unitary or not under the level of each of your SKU's, then assigning the color, and then finally using this measure in the formatting condition.

     

    Measure = 
    VAR A=
    COUNTAX(
        FILTER(ALL('Table'),
        'Table'[SKU]=MAX('Table'[SKU])),
        'Table'[Value])
    RETURN
    IF(
        A>1,
        "Red",
        "Green")

     

     

    I hope my thoughts have solved your problem, if you have any further questions, you can always contact me and I will get back to you as soon as I get the message!

    Hope it helps!

     

    Best regards,
    Community Support Team_ Tom Shen

     

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

     

     

     

     

     

     

3 Replies

  • dharmendars007's avatar
    dharmendars007
    Icon for Memorable Member rankMemorable Member

    Hello Anonymous , 

     

    Please try the below steps , i have created 2 calculated columns and then mapped the same to have the conditional formatting in Table visual.

     

    1, Calculated col 1

     

     

    2.Calculated Col 2

     

     

    Step 3 - add the same to the conditional formatting

     

     

     

    If you find this helpful , please mark it as solution and Your Kudos/Likes are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hey! Thanks for the tip! Although this is not working for the matrix visualization unless I miss something... My view is already created from a different table and what I have presented is a "matrix" view in PowerBI.

       

      I can't do this calculation as my table has different structure.

       

      Any other ideas?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

        I tried to use measure to solve your problem, since there is no option for conditional formatting for Rows in the matrix, I tried to make a color change to value, trying to achieve the same result, I was traversing it with COUNTAX, calculating whether it is unitary or not under the level of each of your SKU's, then assigning the color, and then finally using this measure in the formatting condition.

         

        Measure = 
        VAR A=
        COUNTAX(
            FILTER(ALL('Table'),
            'Table'[SKU]=MAX('Table'[SKU])),
            'Table'[Value])
        RETURN
        IF(
            A>1,
            "Red",
            "Green")

         

         

        I hope my thoughts have solved your problem, if you have any further questions, you can always contact me and I will get back to you as soon as I get the message!

        Hope it helps!

         

        Best regards,
        Community Support Team_ Tom Shen

         

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