Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
Hi all,
I am working with a Power BI matrix where I have months (January–December) displayed as column headers, as shown in the screenshot. no value will display, only the column
Kindly ask for below request solution
I have a DAX in my model (e.g., a measure or flag indicating whether a month is closed):
so the challenge is only related to applying the formatting to the headers.
Thanks for support!
Hi @RAYAN123,
Currently, Power BI does not support conditional formatting for matrix column headers. Conditional formatting can only be applied to values within the visual, not to row or column headers.
1. Create a custom column MonthHeaderColor
MonthHeaderColor =
IF(
'Time Sample'[IsClosedMonth] = TRUE(),
"#70AD47", -- Green
"#A6A6A6" -- Grey
)2. Add Month, MonthNo, IsClosedMonth and MonthHeaderColor to the Values in Deneb Visual.
3. Edit Visual and select Vega-Lite (empty).
4. Add below to the Specification section and Run.
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": { "name": "dataset" },
"transform": [
{
"calculate": "'Header'",
"as": "HeaderRow"
}
],
"width": { "step": 70 },
"height": 45,
"layer": [
{
"mark": {
"type": "rect",
"stroke": "white",
"strokeWidth": 1,
"cornerRadius": 2
},
"encoding": {
"x": {
"field": "Month",
"type": "ordinal",
"sort": { "field": "MonthNo", "order": "ascending" },
"axis": null
},
"y": {
"field": "HeaderRow",
"type": "nominal",
"axis": null
},
"color": {
"field": "MonthHeaderColor",
"type": "nominal",
"scale": null,
"legend": null
},
"tooltip": [
{ "field": "Month", "type": "nominal", "title": "Month" },
{ "field": "IsClosedMonth", "type": "nominal", "title": "Closed?" }
]
}
},
{
"mark": {
"type": "text",
"align": "center",
"baseline": "middle",
"fontSize": 13,
"fontWeight": "bold",
"color": "white"
},
"encoding": {
"x": {
"field": "Month",
"type": "ordinal",
"sort": { "field": "MonthNo", "order": "ascending" }
},
"y": {
"field": "HeaderRow",
"type": "nominal"
},
"text": {
"field": "Month",
"type": "nominal"
}
}
}
],
"config": {
"view": {
"stroke": null
}
}
}5. Result
💡 Did my response help you? Clicking Kudos is a small gesture that goes a long way, it encourages contributors and helps the community thrive!
✅ Did I answer your question? Please mark my post as a Solution, it helps others find the answer faster.
Best Regards,
BI & Fabric Analytics Engineer. @Rupa01
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |