Forum Discussion
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 section, funnela and KPI all are string value as well. and the value column is string value so I have appllied dynamic formatting for calculation and it is working fine. I want to apply conditional formatting on only %types of value with current and previous month as light green if greater else light red. How to achive it since I don't have proper date column as well as date table so I created a new date column based on month_year string value column like from Nov 2025 to 01-09-2025. Please help me I also attached the image for my matrix.
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.
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
9 Replies
- ManasRoutResolver II
Thank you everyone I can able to get this conditional formatting.
- v-menakakotaCommunity Support
Hi ManasRout ,
Thank you for the update.
- Jaywant-ThoratSuper User
Goal: Conditional formatting only for % values in Matrix >> Current Month vs Previous Month
1. Light Green if current > previous
2. Light Red otherwiseStep 1: Convert month_year text >> Date (you already did)
Example (calculated column):
---DAX---
MonthDate =
DATE(
RIGHT([month_year],4),
MONTH(DATEVALUE("01-" & LEFT([month_year],3) & "-2000")),
1
)
---DAX---Step 2: Create numeric % measure (NOT text)
---DAX---
KPI_Value_Num =
VALUE(SUBSTITUTE([Value],"%","")) / 100
---DAX---Step 3: Previous Month measure
---DAX---
KPI_Prev_Month =
CALCULATE(
[KPI_Value_Num],
DATEADD('Table'[MonthDate], -1, MONTH)
)
---DAX---Step 4: Conditional formatting color measure
---DAX---
KPI_Color =
IF(
NOT ISBLANK([KPI_Prev_Month]) &&
[KPI_Value_Num] > [KPI_Prev_Month],
"#C6EFCE", -- light green
"#FFC7CE" -- light red
)
---DAX---Step 5: Apply in Matrix
Matrix → Values
Conditional formatting → Background color
Format by: Field value
Based on field: KPI_Color
Apply only to Value columnResults:
Works even though rows/columns are text
Only % KPIs get colored
Current vs Previous month comparison works
No date table required (though recommended later)
=================================================================
Did I answer your question? Mark my post as a solution! This will help others on the forum!Appreciate your Kudos!!
Jaywant Thorat | MCT | Data Analytics Coach
LinkedIn: https://www.linkedin.com/in/jaywantthorat/
Join #MissionPowerBIBharat = https://shorturl.at/5ViW9
#MissionPowerBIBharat
LIVE with Jaywant Thorat from 10 Jan 2026
8 Days | 8 Sessions | 1 hr daily | 100% Free- ManasRoutResolver II
Hi JaywantThank you for providing this solution the value column contain different types of value so I have applied dynamic formatting to bring a single format but after following your steps it applied for all values like %types as well as Non %types I want only apply on %types of value also it coming all are light red still not working. Please let me know If I need to share anything else for better understanding my requirement.
- danextianSuper User
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.
- ManasRoutResolver II
Hi Danextian, Thank for providing this solution It is not working I am sharing my demo dataset in here since I don't have access to share outside from my laptop along with pbix image since it is not allowing me. In this I am using a matrix visual with under rows I am using 3columns (Section, Funnel, KPI), under columns I am using 3columns(country, retailerid, month_year) under values I am using summarize by sum(Sheet[Value]) and make it dynamic measure using below code.
SWITCH(
SELECTEDVALUE(Sheet1[KPI]),
"No. of hero skus", "0",
"Listing Share", "0" & """%""",
"Availability (Hero SKU)", "0" & """%""",
"Content Execution on PDP", "0" & """%""",
"Rating And Reviews", "0" & """%""",
"In search", "0" & """%""",
"On category page", "0" & """%""",
"Impression Share (only for specific formats).", "0" & """%""",
"Revenue (EUR)", "#,.00k",
"Spent (EUR)", "#,.00k",
"ROAS", "0.00"
)
I am also using 3page level filter (category_name(need to select 1value - Laptop), country(I kept only 1value - india), report_period - 202512). So I want to calculate month over sales for only %types of value if my current month value greater previous then light green else red if same no change based on different retailer_id. I shared sample dataset- ManasRoutResolver IISection Funnel country Retailerid month_year Category date year month report_period KPI ValueC South India JioMart Sep'25 Tablet 202509 2025 9 202511 Listing Share 100C South India Amazon Sep'25 Laptop 202509 2025 9 202511 Listing Share 100C South India Amazon Sep'25 Mobile 202509 2025 9 202511 Listing Share 100C South India JioMart Sep'25 Mobile 202509 2025 9 202511 Listing Share 100C South India Amazon Oct'25 Laptop 202510 2025 10 202511 Listing Share 100C South India Amazon Oct'25 Mobile 202510 2025 10 202512 Listing Share 100A West India Amazon Nov'25 Mobile 202511 2025 11 202511 Availability (Hero SKU) 100A West India JioMart Nov'25 Laptop 202511 2025 11 202511 Availability (Hero SKU) 100A West India JioMart Nov'25 Tablet 202511 2025 11 202511 Availability (Hero SKU) 100A West India JioMart Nov'25 Mobile 202511 2025 11 202511 Availability (Hero SKU) 100A West India Amazon Oct'25 Tablet 202510 2025 10 202512 Content Execution on PDP 100A West India Amazon Oct'25 Laptop 202510 2025 10 202512 Content Execution on PDP 100A West India Amazon Oct'25 Mobile 202510 2025 10 202512 Content Execution on PDP 100West India JioMart Dec'25 Tablet 202512 2025 12 202512 Availability (Hero SKU) 100A West India JioMart Oct'25 Mobile 202510 2025 10 202512 Availability (Hero SKU) 100A West India Amazon Oct'25 Mobile 202510 2025 10 202512 Availability (Hero SKU) 100A West India JioMart Nov'25 Laptop 202511 2025 11 202512 Rating And Reviews 100A West India Amazon Nov'25 Mobile 202511 2025 11 202512 Rating And Reviews 100A West India Amazon Oct'25 Tablet 202510 2025 10 202512 Rating And Reviews 100A West India Amazon Oct'25 Mobile 202510 2025 10 202512 Rating And Reviews 100West India JioMart Oct'25 Laptop 202510 2025 10 202511 Availability (Hero SKU) 92A West India Amazon Nov'25 Tablet 202511 2025 11 202511 Availability (Hero SKU) 70A West India Amazon Nov'25 Laptop 202511 2025 11 202511 Availability (Hero SKU) 92A West India Amazon Sep'25 Laptop 202509 2025 9 202511 Rating And Reviews 80A West India Amazon Sep'25 Mobile 202509 2025 9 202511 Rating And Reviews 50A West India JioMart Sep'25 Mobile 202509 2025 9 202511 Rating And Reviews 50A West India JioMart Oct'25 Mobile 202510 2025 10 202511 Rating And Reviews 63A West India Amazon Oct'25 Mobile 202510 2025 10 202511 Rating And Reviews 88A West India Amazon Nov'25 Mobile 202511 2025 11 202511 Rating And Reviews 50A West India JioMart Nov'25 Mobile 202511 2025 11 202511 Rating And Reviews 88A West India JioMart Dec'25 Laptop 202512 2025 12 202512 Content Execution on PDP 84A West India Amazon Dec'25 Mobile 202512 2025 12 202512 Content Execution on PDP 63A West India JioMart Oct'25 Mobile 202510 2025 10 202512 Content Execution on PDP 63A West India JioMart Oct'25 Laptop 202510 2025 10 202512 Content Execution on PDP 59A West India Amazon Nov'25 Tablet 202511 2025 11 202512 Availability (Hero SKU) 92A West India Amazon Nov'25 Laptop 202511 2025 11 202512 Availability (Hero SKU) 88A West India JioMart Dec'25 Laptop 202512 2025 12 202512 Availability (Hero SKU) 97A West India Amazon Dec'25 Mobile 202512 2025 12 202512 Availability (Hero SKU) 57A West India Amazon Dec'25 Laptop 202512 2025 12 202512 Availability (Hero SKU) 91A West India Amazon Dec'25 Tablet 202512 2025 12 202512 Availability (Hero SKU) 93A West India JioMart Nov'25 Mobile 202511 2025 11 202512 Rating And Reviews 50A West India JioMart Dec'25 Mobile 202512 2025 12 202512 Rating And Reviews 50A West India Amazon Dec'25 Mobile 202512 2025 12 202512 Rating And Reviews 50A West India JioMart Oct'25 Mobile 202510 2025 10 202512 Rating And Reviews 50A West India Amazon Oct'25 Laptop 202510 2025 10 202512 Rating And Reviews 50B North India JioMart Sep'25 Tablet 202509 2025 9 202511 No. of hero skus 2B North India JioMart Sep'25 Laptop 202509 2025 9 202511 No. of hero skus 2B North India Amazon Sep'25 Tablet 202509 2025 9 202511 No. of hero skus 2B North India Amazon Sep'25 Laptop 202509 2025 9 202511 No. of hero skus 2B North India Amazon Sep'25 Mobile 202509 2025 9 202511 No. of hero skus 2B North India JioMart Sep'25 Mobile 202509 2025 9 202511 No. of hero skus 2B North India Amazon Dec'25 Laptop 202512 2025 12 202512 No. of hero skus 2B North India Amazon Dec'25 Tablet 202512 2025 12 202512 No. of hero skus 2B North India JioMart Oct'25 Tablet 202510 2025 10 202512 No. of hero skus 2B North India JioMart Oct'25 Mobile 202510 2025 10 202512 No. of hero skus 2B North India JioMart Oct'25 Laptop 202510 2025 10 202512 No. of hero skus 2B North India Amazon Oct'25 Tablet 202510 2025 10 202512 No. of hero skus 2B North India Amazon Oct'25 Laptop 202510 2025 10 202512 No. of hero skus 2B North India Amazon Oct'25 Mobile 202510 2025 10 202512 No. of hero skus 1A West India JioMart Sep'25 Tablet 202509 2025 9 202511 Rating And Reviews 0A West India JioMart Sep'25 Laptop 202509 2025 9 202511 Rating And Reviews 0A West India Amazon Sep'25 Tablet 202509 2025 9 202511 Rating And Reviews 0A West India Amazon Oct'25 Laptop 202510 2025 10 202511 Rating And Reviews 13A West India JioMart Oct'25 Tablet 202510 2025 10 202511 Rating And Reviews 0A West India Amazon Oct'25 Tablet 202510 2025 10 202511 Rating And Reviews 0A West India JioMart Oct'25 Laptop 202510 2025 10 202511 Rating And Reviews 0A West India Amazon Nov'25 Tablet 202511 2025 11 202511 Rating And Reviews 0A West India Amazon Nov'25 Laptop 202511 2025 11 202511 Rating And Reviews 0A West India JioMart Nov'25 Laptop 202511 2025 11 202511 Rating And Reviews 0A West India JioMart Nov'25 Tablet 202511 2025 11 202511 Rating And Reviews 0A West India JioMart Sep'25 Tablet 202509 2025 9 202511 Content Execution on PDP 84A West India Amazon Sep'25 Tablet 202509 2025 9 202511 Content Execution on PDP 84A West India Amazon Sep'25 Laptop 202509 2025 9 202511 Content Execution on PDP 77A West India Amazon Sep'25 Mobile 202509 2025 9 202511 Content Execution on PDP 84A West India Amazon Oct'25 Laptop 202510 2025 10 202511 Content Execution on PDP 73A West India JioMart Oct'25 Tablet 202510 2025 10 202511 Content Execution on PDP 84A West India Amazon Oct'25 Tablet 202510 2025 10 202511 Content Execution on PDP 77A West India Amazon Oct'25 Mobile 202510 2025 10 202511 Content Execution on PDP 84A West India Amazon Nov'25 Tablet 202511 2025 11 202511 Content Execution on PDP 84A West India Amazon Nov'25 Mobile 202511 2025 11 202511 Content Execution on PDP 63AWestIndiaAmazonNov'25Laptop202511202511202511On category pageAWestIndiaJioMartNov'25Laptop202511202511202511On category pageAWestIndiaJioMartNov'25Tablet202511202511202511On category pageAWestIndiaJioMartNov'25Mobile202511202511202511On category pageA East India JioMart Sep'25 Mobile 202509 2025 9 202511 ROAS 15A East India JioMart Sep'25 TV 202509 2025 9 202511 ROAS 9A East India JioMart Sep'25 Earphone 202509 2025 9 202511 ROAS 14A East India JioMart Sep'25 Aquagard 202509 2025 9 202511 ROAS 18A East India JioMart Sep'25 Tablet 202509 2025 9 202511 ROAS 8A East India JioMart Sep'25 Mobile 202509 2025 9 202511 Revenue (EUR) 164730A East India JioMart Sep'25 TV 202509 2025 9 202511 Revenue (EUR) 360650A East India JioMart Sep'25 Earphone 202509 2025 9 202511 Revenue (EUR) 570980A East India JioMart Sep'25 Aquagard 202509 2025 9 202511 Revenue (EUR) 467890A East India JioMart Sep'25 Tablet 202509 2025 9 202511 Revenue (EUR) 435670A East India JioMart Sep'25 Mobile 202509 2025 9 202511 Spent (EUR) 11197A East India JioMart Sep'25 TV 202509 2025 9 202511 Spent (EUR) 41858A East India JioMart Sep'25 Earphone 202509 2025 9 202511 Spent (EUR) 44997A East India JioMart Sep'25 Aquagard 202509 2025 9 202511 Spent (EUR) 6264A East India JioMart Sep'25 Tablet 202509 2025 9 202511 Spent (EUR) 15741A East India JioMart Oct'25 Mobile 202510 2025 10 202511 ROAS 18A East India JioMart Oct'25 TV 202510 2025 10 202511 ROAS 12A East India JioMart Oct'25 Aquagard 202510 2025 10 202511 ROAS 9A East India JioMart Oct'25 Tablet 202510 2025 10 202511 ROAS 15A East India JioMart Nov'25 Earphone 202511 2025 11 202511 ROAS 13A East India JioMart Nov'25 Aquagard 202511 2025 11 202511 ROAS 0A East India JioMart Nov'25 Tablet 202511 2025 11 202511 ROAS 0A East India JioMart Nov'25 Mobile 202511 2025 11 202511 Revenue (EUR) 1746A East India JioMart Nov'25 TV 202511 2025 11 202511 Revenue (EUR) 10354A East India JioMart Nov'25 Earphone 202511 2025 11 202511 Revenue (EUR) 158464A East India JioMart Nov'25 Aquagard 202511 2025 11 202511 Revenue (EUR) 249A East India JioMart Nov'25 Tablet 202511 2025 11 202511 Revenue (EUR) 668A East India JioMart Nov'25 Mobile 202511 2025 11 202511 Spent (EUR) 148A East India JioMart Nov'25 TV 202511 2025 11 202511 Spent (EUR) 1277A East India JioMart Nov'25 Earphone 202511 2025 11 202511 Spent (EUR) 12132A East India JioMart Nov'25 Aquagard 202511 2025 11 202511 Spent (EUR) 0A East India JioMart Nov'25 Tablet 202511 2025 11 202511 Spent (EUR) 0AWestIndiaJioMartNov'25Mobile202511202511202511In searchA West India JioMart Oct'25 Mobile 202510 2025 10 202511 In search 8A West India Amazon Nov'25 Tablet 202511 2025 11 202511 In search 18A West India Amazon Oct'25 Tablet 202510 2025 10 202511 In search 22A West India Amazon Sep'25 Tablet 202509 2025 9 202511 In search 10AWestIndiaAmazonOct'25Laptop202510202510202512On category pageAWestIndiaAmazonOct'25Mobile202510202510202512On category pageA West India JioMart Nov'25 Tablet 202511 2025 11 202512 In search 21AWestIndiaJioMartNov'25Laptop202511202511202512In searchAWestIndiaJioMartNov'25Mobile202511202511202512In searchA West India Amazon Oct'25 Tablet 202510 2025 10 202512 In search 25A West India Amazon Oct'25 Laptop 202510 2025 10 202512 In search 26A West India Amazon Oct'25 Mobile 202510 2025 10 202512 In search 26A East India JioMart Dec'25 Mobile 202512 2025 12 202512 Revenue (EUR) 203A East India JioMart Dec'25 Mobile 202512 2025 12 202512 Spent (EUR) 0A East India JioMart Dec'25 Mobile 202512 2025 12 202512 ROAS 0A East India JioMart Nov'25 Mobile 202511 2025 11 202512 Revenue (EUR) 5154A East India JioMart Nov'25 Mobile 202511 2025 11 202512 Spent (EUR) 0A East India JioMart Nov'25 Mobile 202511 2025 11 202512 ROAS 0A East India JioMart Nov'25 Laptop 202511 2025 11 202512 Revenue (EUR) 95982A East India JioMart Nov'25 Laptop 202511 2025 11 202512 Spent (EUR) 11749A East India JioMart Nov'25 Laptop 202511 2025 11 202512 ROAS 8A East India JioMart Nov'25 Tablet 202511 2025 11 202512 Revenue (EUR) 63089A East India JioMart Nov'25 Tablet 202511 2025 11 202512 Spent (EUR) 5674A East India JioMart Nov'25 Tablet 202511 2025 11 202512 ROAS 7A East India JioMart Oct'25 Mobile 202510 2025 10 202512 Revenue (EUR) 2990A East India JioMart Oct'25 Mobile 202510 2025 10 202512 Spent (EUR) 362A East India JioMart Oct'25 Mobile 202510 2025 10 202512 ROAS 8A East India JioMart Oct'25 Laptop 202510 2025 10 202512 Revenue (EUR) 17098A East India JioMart Oct'25 Laptop 202510 2025 10 202512 Spent (EUR) 2676A East India JioMart Oct'25 Laptop 202510 2025 10 202512 ROAS 6A East India JioMart Oct'25 Tablet 202510 2025 10 202512 Revenue (EUR) 724575A East India JioMart Oct'25 Tablet 202510 2025 10 202512 Spent (EUR) 23489A East India JioMart Oct'25 Tablet 202510 2025 10 202512 ROAS 9A West India JioMart Nov'25 Tablet 202511 2025 11 202512 Rating And Reviews 0