Forum Discussion

ManasRout's avatar
ManasRout
Resolver II
7 months ago
Solved

Want to apply Conditional Formatting on Matrix Visual

Hi Team, Can you please help me on the below conditional formatting on matrix visual I have 4columns all are string value like country, countrylogo, retailer_id and month_year. Also 4rows like sectio...
  • danextian's avatar
    7 months ago

    Hi ManasRout 

    Below asssumes that you are using a dedicated dates table and has been set as such.

     

    Conditional formatting color =
    VAR _formatString =
        IF ( SELECTEDVALUE ( table[value] ) = "this value", "0%", "#,#" ) --replace with your actual format string formula
    VAR _prevMonth =
        CALCULATE ( [your measure], PREVIOUSMONTH ( DatesTable[Date] ) )
    VAR _diff = [your measure] - _prevMonth
    VAR _color =
        IF ( _diff < 0, "red", "green" ) --replace with HEX, RGB or RGBA colors
    RETURN
        IF ( _formatString = "0%", _color )
    

    In conditional formatting dialog box, select Field Value as use the above formula.

    If this doesn't work, please provide  a sanitzied copy of your pbix (confidential data removed). You may post a link to a cloud storage.

  • v-menakakota's avatar
    v-menakakota
    7 months ago

    Hi ManasRout ,
    Thanks for reaching out to the Microsoft fabric community forum. 

    Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI…

     

    Best Regards, 
    Community Support Team