Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ManasRout
Helper II
Helper II

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 matrixScreenshot 2026-01-17 102148.png.

2 ACCEPTED SOLUTIONS
danextian
Super User
Super 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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

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 

View solution in original post

9 REPLIES 9
ManasRout
Helper II
Helper II

Thank you everyone I can able to get this conditional formatting.

Hi @ManasRout ,

Thank you for the update.

danextian
Super User
Super 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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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

 

 

Section Funnel country Retailerid month_year Category date year month report_period KPI Value
C South India JioMart Sep'25 Tablet 202509 2025 9 202511 Listing Share 100
C South India Amazon Sep'25 Laptop 202509 2025 9 202511 Listing Share 100
C South India Amazon Sep'25 Mobile 202509 2025 9 202511 Listing Share 100
C South India JioMart Sep'25 Mobile 202509 2025 9 202511 Listing Share 100
C South India Amazon Oct'25 Laptop 202510 2025 10 202511 Listing Share 100
C South India Amazon Oct'25 Mobile 202510 2025 10 202512 Listing Share 100
A West India Amazon Nov'25 Mobile 202511 2025 11 202511 Availability (Hero SKU) 100
A West India JioMart Nov'25 Laptop 202511 2025 11 202511 Availability (Hero SKU) 100
A West India JioMart Nov'25 Tablet 202511 2025 11 202511 Availability (Hero SKU) 100
A West India JioMart Nov'25 Mobile 202511 2025 11 202511 Availability (Hero SKU) 100
A West India Amazon Oct'25 Tablet 202510 2025 10 202512 Content Execution on PDP 100
A West India Amazon Oct'25 Laptop 202510 2025 10 202512 Content Execution on PDP 100
A West India Amazon Oct'25 Mobile 202510 2025 10 202512 Content Execution on PDP 100
West India JioMart Dec'25 Tablet 202512 2025 12 202512 Availability (Hero SKU) 100
A West India JioMart Oct'25 Mobile 202510 2025 10 202512 Availability (Hero SKU) 100
A West India Amazon Oct'25 Mobile 202510 2025 10 202512 Availability (Hero SKU) 100
A West India JioMart Nov'25 Laptop 202511 2025 11 202512 Rating And Reviews 100
A West India Amazon Nov'25 Mobile 202511 2025 11 202512 Rating And Reviews 100
A West India Amazon Oct'25 Tablet 202510 2025 10 202512 Rating And Reviews 100
A West India Amazon Oct'25 Mobile 202510 2025 10 202512 Rating And Reviews 100
West India JioMart Oct'25 Laptop 202510 2025 10 202511 Availability (Hero SKU) 92
A West India Amazon Nov'25 Tablet 202511 2025 11 202511 Availability (Hero SKU) 70
A West India Amazon Nov'25 Laptop 202511 2025 11 202511 Availability (Hero SKU) 92
A West India Amazon Sep'25 Laptop 202509 2025 9 202511 Rating And Reviews 80
A West India Amazon Sep'25 Mobile 202509 2025 9 202511 Rating And Reviews 50
A West India JioMart Sep'25 Mobile 202509 2025 9 202511 Rating And Reviews 50
A West India JioMart Oct'25 Mobile 202510 2025 10 202511 Rating And Reviews 63
A West India Amazon Oct'25 Mobile 202510 2025 10 202511 Rating And Reviews 88
A West India Amazon Nov'25 Mobile 202511 2025 11 202511 Rating And Reviews 50
A West India JioMart Nov'25 Mobile 202511 2025 11 202511 Rating And Reviews 88
A West India JioMart Dec'25 Laptop 202512 2025 12 202512 Content Execution on PDP 84
A West India Amazon Dec'25 Mobile 202512 2025 12 202512 Content Execution on PDP 63
A West India JioMart Oct'25 Mobile 202510 2025 10 202512 Content Execution on PDP 63
A West India JioMart Oct'25 Laptop 202510 2025 10 202512 Content Execution on PDP 59
A West India Amazon Nov'25 Tablet 202511 2025 11 202512 Availability (Hero SKU) 92
A West India Amazon Nov'25 Laptop 202511 2025 11 202512 Availability (Hero SKU) 88
A West India JioMart Dec'25 Laptop 202512 2025 12 202512 Availability (Hero SKU) 97
A West India Amazon Dec'25 Mobile 202512 2025 12 202512 Availability (Hero SKU) 57
A West India Amazon Dec'25 Laptop 202512 2025 12 202512 Availability (Hero SKU) 91
A West India Amazon Dec'25 Tablet 202512 2025 12 202512 Availability (Hero SKU) 93
A West India JioMart Nov'25 Mobile 202511 2025 11 202512 Rating And Reviews 50
A West India JioMart Dec'25 Mobile 202512 2025 12 202512 Rating And Reviews 50
A West India Amazon Dec'25 Mobile 202512 2025 12 202512 Rating And Reviews 50
A West India JioMart Oct'25 Mobile 202510 2025 10 202512 Rating And Reviews 50
A West India Amazon Oct'25 Laptop 202510 2025 10 202512 Rating And Reviews 50
B North India JioMart Sep'25 Tablet 202509 2025 9 202511 No. of hero skus 2
B North India JioMart Sep'25 Laptop 202509 2025 9 202511 No. of hero skus 2
B North India Amazon Sep'25 Tablet 202509 2025 9 202511 No. of hero skus 2
B North India Amazon Sep'25 Laptop 202509 2025 9 202511 No. of hero skus 2
B North India Amazon Sep'25 Mobile 202509 2025 9 202511 No. of hero skus 2
B North India JioMart Sep'25 Mobile 202509 2025 9 202511 No. of hero skus 2
B North India Amazon Dec'25 Laptop 202512 2025 12 202512 No. of hero skus 2
B North India Amazon Dec'25 Tablet 202512 2025 12 202512 No. of hero skus 2
B North India JioMart Oct'25 Tablet 202510 2025 10 202512 No. of hero skus 2
B North India JioMart Oct'25 Mobile 202510 2025 10 202512 No. of hero skus 2
B North India JioMart Oct'25 Laptop 202510 2025 10 202512 No. of hero skus 2
B North India Amazon Oct'25 Tablet 202510 2025 10 202512 No. of hero skus 2
B North India Amazon Oct'25 Laptop 202510 2025 10 202512 No. of hero skus 2
B North India Amazon Oct'25 Mobile 202510 2025 10 202512 No. of hero skus 1
A West India JioMart Sep'25 Tablet 202509 2025 9 202511 Rating And Reviews 0
A West India JioMart Sep'25 Laptop 202509 2025 9 202511 Rating And Reviews 0
A West India Amazon Sep'25 Tablet 202509 2025 9 202511 Rating And Reviews 0
A West India Amazon Oct'25 Laptop 202510 2025 10 202511 Rating And Reviews 13
A West India JioMart Oct'25 Tablet 202510 2025 10 202511 Rating And Reviews 0
A West India Amazon Oct'25 Tablet 202510 2025 10 202511 Rating And Reviews 0
A West India JioMart Oct'25 Laptop 202510 2025 10 202511 Rating And Reviews 0
A West India Amazon Nov'25 Tablet 202511 2025 11 202511 Rating And Reviews 0
A West India Amazon Nov'25 Laptop 202511 2025 11 202511 Rating And Reviews 0
A West India JioMart Nov'25 Laptop 202511 2025 11 202511 Rating And Reviews 0
A West India JioMart Nov'25 Tablet 202511 2025 11 202511 Rating And Reviews 0
A West India JioMart Sep'25 Tablet 202509 2025 9 202511 Content Execution on PDP 84
A West India Amazon Sep'25 Tablet 202509 2025 9 202511 Content Execution on PDP 84
A West India Amazon Sep'25 Laptop 202509 2025 9 202511 Content Execution on PDP 77
A West India Amazon Sep'25 Mobile 202509 2025 9 202511 Content Execution on PDP 84
A West India Amazon Oct'25 Laptop 202510 2025 10 202511 Content Execution on PDP 73
A West India JioMart Oct'25 Tablet 202510 2025 10 202511 Content Execution on PDP 84
A West India Amazon Oct'25 Tablet 202510 2025 10 202511 Content Execution on PDP 77
A West India Amazon Oct'25 Mobile 202510 2025 10 202511 Content Execution on PDP 84
A West India Amazon Nov'25 Tablet 202511 2025 11 202511 Content Execution on PDP 84
A West India Amazon Nov'25 Mobile 202511 2025 11 202511 Content Execution on PDP 63
AWestIndiaAmazonNov'25Laptop202511202511202511On category page
AWestIndiaJioMartNov'25Laptop202511202511202511On category page
AWestIndiaJioMartNov'25Tablet202511202511202511On category page
AWestIndiaJioMartNov'25Mobile202511202511202511On category page
A East India JioMart Sep'25 Mobile 202509 2025 9 202511 ROAS 15
A East India JioMart Sep'25 TV 202509 2025 9 202511 ROAS 9
A East India JioMart Sep'25 Earphone 202509 2025 9 202511 ROAS 14
A East India JioMart Sep'25 Aquagard 202509 2025 9 202511 ROAS 18
A East India JioMart Sep'25 Tablet 202509 2025 9 202511 ROAS 8
A East India JioMart Sep'25 Mobile 202509 2025 9 202511 Revenue (EUR) 164730
A East India JioMart Sep'25 TV 202509 2025 9 202511 Revenue (EUR) 360650
A East India JioMart Sep'25 Earphone 202509 2025 9 202511 Revenue (EUR) 570980
A East India JioMart Sep'25 Aquagard 202509 2025 9 202511 Revenue (EUR) 467890
A East India JioMart Sep'25 Tablet 202509 2025 9 202511 Revenue (EUR) 435670
A East India JioMart Sep'25 Mobile 202509 2025 9 202511 Spent (EUR) 11197
A East India JioMart Sep'25 TV 202509 2025 9 202511 Spent (EUR) 41858
A East India JioMart Sep'25 Earphone 202509 2025 9 202511 Spent (EUR) 44997
A East India JioMart Sep'25 Aquagard 202509 2025 9 202511 Spent (EUR) 6264
A East India JioMart Sep'25 Tablet 202509 2025 9 202511 Spent (EUR) 15741
A East India JioMart Oct'25 Mobile 202510 2025 10 202511 ROAS 18
A East India JioMart Oct'25 TV 202510 2025 10 202511 ROAS 12
A East India JioMart Oct'25 Aquagard 202510 2025 10 202511 ROAS 9
A East India JioMart Oct'25 Tablet 202510 2025 10 202511 ROAS 15
A East India JioMart Nov'25 Earphone 202511 2025 11 202511 ROAS 13
A East India JioMart Nov'25 Aquagard 202511 2025 11 202511 ROAS 0
A East India JioMart Nov'25 Tablet 202511 2025 11 202511 ROAS 0
A East India JioMart Nov'25 Mobile 202511 2025 11 202511 Revenue (EUR) 1746
A East India JioMart Nov'25 TV 202511 2025 11 202511 Revenue (EUR) 10354
A East India JioMart Nov'25 Earphone 202511 2025 11 202511 Revenue (EUR) 158464
A East India JioMart Nov'25 Aquagard 202511 2025 11 202511 Revenue (EUR) 249
A East India JioMart Nov'25 Tablet 202511 2025 11 202511 Revenue (EUR) 668
A East India JioMart Nov'25 Mobile 202511 2025 11 202511 Spent (EUR) 148
A East India JioMart Nov'25 TV 202511 2025 11 202511 Spent (EUR) 1277
A East India JioMart Nov'25 Earphone 202511 2025 11 202511 Spent (EUR) 12132
A East India JioMart Nov'25 Aquagard 202511 2025 11 202511 Spent (EUR) 0
A East India JioMart Nov'25 Tablet 202511 2025 11 202511 Spent (EUR) 0
AWestIndiaJioMartNov'25Mobile202511202511202511In search
A West India JioMart Oct'25 Mobile 202510 2025 10 202511 In search 8
A West India Amazon Nov'25 Tablet 202511 2025 11 202511 In search 18
A West India Amazon Oct'25 Tablet 202510 2025 10 202511 In search 22
A West India Amazon Sep'25 Tablet 202509 2025 9 202511 In search 10
AWestIndiaAmazonOct'25Laptop202510202510202512On category page
AWestIndiaAmazonOct'25Mobile202510202510202512On category page
A West India JioMart Nov'25 Tablet 202511 2025 11 202512 In search 21
AWestIndiaJioMartNov'25Laptop202511202511202512In search
AWestIndiaJioMartNov'25Mobile202511202511202512In search
A West India Amazon Oct'25 Tablet 202510 2025 10 202512 In search 25
A West India Amazon Oct'25 Laptop 202510 2025 10 202512 In search 26
A West India Amazon Oct'25 Mobile 202510 2025 10 202512 In search 26
A East India JioMart Dec'25 Mobile 202512 2025 12 202512 Revenue (EUR) 203
A East India JioMart Dec'25 Mobile 202512 2025 12 202512 Spent (EUR) 0
A East India JioMart Dec'25 Mobile 202512 2025 12 202512 ROAS 0
A East India JioMart Nov'25 Mobile 202511 2025 11 202512 Revenue (EUR) 5154
A East India JioMart Nov'25 Mobile 202511 2025 11 202512 Spent (EUR) 0
A East India JioMart Nov'25 Mobile 202511 2025 11 202512 ROAS 0
A East India JioMart Nov'25 Laptop 202511 2025 11 202512 Revenue (EUR) 95982
A East India JioMart Nov'25 Laptop 202511 2025 11 202512 Spent (EUR) 11749
A East India JioMart Nov'25 Laptop 202511 2025 11 202512 ROAS 8
A East India JioMart Nov'25 Tablet 202511 2025 11 202512 Revenue (EUR) 63089
A East India JioMart Nov'25 Tablet 202511 2025 11 202512 Spent (EUR) 5674
A East India JioMart Nov'25 Tablet 202511 2025 11 202512 ROAS 7
A East India JioMart Oct'25 Mobile 202510 2025 10 202512 Revenue (EUR) 2990
A East India JioMart Oct'25 Mobile 202510 2025 10 202512 Spent (EUR) 362
A East India JioMart Oct'25 Mobile 202510 2025 10 202512 ROAS 8
A East India JioMart Oct'25 Laptop 202510 2025 10 202512 Revenue (EUR) 17098
A East India JioMart Oct'25 Laptop 202510 2025 10 202512 Spent (EUR) 2676
A East India JioMart Oct'25 Laptop 202510 2025 10 202512 ROAS 6
A East India JioMart Oct'25 Tablet 202510 2025 10 202512 Revenue (EUR) 724575
A East India JioMart Oct'25 Tablet 202510 2025 10 202512 Spent (EUR) 23489
A East India JioMart Oct'25 Tablet 202510 2025 10 202512 ROAS 9
A West India JioMart Nov'25 Tablet 202511 2025 11 202512 Rating And Reviews 0

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 

Hi @ManasRout ,

It's been a while since we last heard from you. We are ready to assist you with resolving the issue, but we need the necessary details from you. Kindly share the information required so we can better understand and address your issue.

 

Best Regards, 
Community Support Team 

Jaywant-Thorat
Super User
Super User

Goal: Conditional formatting only for % values in Matrix  >> Current Month vs Previous Month
1. Light Green if current > previous
2. Light Red otherwise

 

Step 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 column

 

Results:
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

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. Screenshot 2026-01-17 155543.png

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.