Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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.
Solved! Go to Solution.
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
Thank you everyone I can able to get this conditional formatting.
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 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
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.
Community Support Team
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 50 | |
| 34 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 77 | |
| 41 | |
| 26 | |
| 26 |