The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
82 | |
77 | |
46 | |
39 |
User | Count |
---|---|
137 | |
108 | |
69 | |
64 | |
53 |