Forum Discussion

Sno_93's avatar
Sno_93
Frequent Visitor
3 months ago
Solved

How to Add an Icon for Row-Wise Maximum Across Columns

I have a matrix visual with row heading Status, and column heading Month_Type and value Pct, please see below sample. I want to add a flag icon that will look across the columns and mark the highest value. Eg, in below screenshot, for Row D1, I want the value in column TM, 37.7% to be marked with a green flag. And for row D2, value in column LM, 35.5%. How do I go about identifying the maximum? I have tried the below code and it marks all the columns as maximum

 

 

Max_Across_Periods = 
MAXX(
    ALL('3. Appended_Status'[Month_Type]),
    CALCULATE([Pct])
)

 

10 Replies

  • Hi Sno_93 ,

     

    You can achieve the same by Flag measure which should highlight the maximum value in the row and then use this measure in Back ground conditional formatting.

     

    I've created a sample .pbix file, kindly refer attached file and let me know if that's your requirement.

     

    ๐ŸŒŸ I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
    ๐Ÿ’ก Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
    ๐ŸŽ– As a proud SuperUser and Microsoft Partner, weโ€™re here to empower your data journey and the Power BI Community at large.
    ๐Ÿ”— Curious to explore more? [Discover here].
    Letโ€™s keep building smarter solutions together!

    • Sno_93's avatar
      Sno_93
      Frequent Visitor

      Thank you, grazitti_sapna .However it isn't working the way that I want it to. I wonder if it is because Pct values themselves are measures.

      • grazitti_sapna's avatar
        grazitti_sapna
        Icon for Super User rankSuper User

        Hi Sno_93,

         

        I don't think that is the issue, you can try creating a measure on top ot PCT values and implement the same as i did in the sample .pbix file. what is the issue you are facing? any errors?

  • Hello Sno_93 ,

     

    To achieve this you should behave the column values like a table. 

    Max Value =
    MAXX(
     {[TM],
      [LM],
      [LY]},
    [Value]
    )

     

    this code will work for you. If you are interested you can read my old blog with translating:
    https://medium.com/@anilelmastasi/power-bi-i%CC%87kiden-fazla-s%C3%BCtun-aras%C4%B1nda-maksimum-de%C4%9Feri-olan-sat%C4%B1r%C4%B1-bulmak-04cb436d0c19

     

    If this solved your issue, please mark it as the accepted solution. โœ…

  • v-echaithra's avatar
    v-echaithra
    Icon for Community Support rankCommunity Support

    Hi Sno_93 ,

    If you get a chance, please review the response shared abiiove and let us know if it aligns with your expectations. Should you need any additional details or clarification, feel free to let us know.

     

    Regards,
    Chaithra E.

  • v-echaithra's avatar
    v-echaithra
    Icon for Community Support rankCommunity Support

    Hi Sno_93 ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.

    • Sno_93's avatar
      Sno_93
      Frequent Visitor

      I have resolved the issue