March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm struggling to learn Power BI, and in this case specifically Deneb. I'm grateful for help on this last piece to get my project to completion. I'm aiming for this sort of look except with project names on the bars (which I've deleted due to sensitivity). Of note is the opacity feature to highlight the selected tier. Currently, I have the correct number of bolded bars, they just all show at the bottom of each stack rather than on the correct bars. Using my dataset, I have a measure to compute the total [=CALCULATE(COUNT(table[name]), VALUES(table[group]))] and a slicer on "tier."
My vega lite code is approximately this. How do I tweak the fillOpacity so it would bold the correct bars?
{
"data": {
"values": [
{"name": "A", "group": "Low", "tier": "Tier 3"},
{"name": "B", "group": "Low", "tier": "Tier 1"},
{"name": "C", "group": "Med", "tier": "Tier 1"},
{"name": "D", "group": "High", "tier": "Tier 2"},
{"name": "E", "group": "High", "tier": "Tier 3"},
{"name": "F", "group": "High", "tier": "Tier 1"}
]
},
"layer": [
{
"mark": {
"type": "bar",
"stroke": "black",
"strokeWidth": 1,
"tooltip": true
},
"encoding": {
"y": {
"field": "total",
"type": "quantitative"
}
},
"fill": {
"field": "group",
"type": "nominal",
"scale": {
"domain": [
"Low",
"Med",
"High"
],
"range": [
"#e15759",
"#ffff00",
"#59a14f"
]
}
},
"fillOpacity": {
"field": "Opacity"
}
}
]
},
{
"mark": {"type": "text", "dy": -10},
"encoding": {
"text": {
"field": "total",
"type": "quantitative",
"aggregate": "sum"
},
"y": {
"field": "total",
"type": "quantitative",
"aggregate": "sum"
}
}
},
{
"mark": {"type": "text"},
"encoding": {
"text": {
"field": "name",
"type": "nominal"
},
"y": {
"field": "total",
"type": "quantitative",
"stack": true,
"bandPosition": 0.5
}
}
}
Hi @patBear ,
Please refer to the following thread:
If I have misunderstood your meaning, please provide more details.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I'm focused on the fillOpacity function and getting it to highlight the correct bars. I've created a more clearly stated question with working code: see highlighting bars in Deneb - fillOpacity - Microsoft Power BI Community
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |