Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is it possible to set up a Deneb visual to be blank until a slicer is selected?
I have a measure that looks like this (is blank until a Country is selected in the slicer):
and when I selected a country in the slicer, it does update, but still doesn't show the country I selected:
Any tips on how to set the deneb visual to be blank until a country is selected? I double checked my code (see below), the new countryblank measure is all there in vega-lite. I tried using a card that becomes transparent when a slicer is selected but realized that won't work for me because the point of the deneb visual is to be interactive (vertical line on mouseover) and the card prevents me from using mouseover.
{
"data": {"name": "dataset"},
"width": 600,
"height": 500,
"layer": [
{
"encoding": {
"x": {"field": "Year_formatted", "type": "temporal", "title": "Years (YYYY)"},
"y": {"field": "Index Score", "type": "quantitative", "title": "Score"},
"color": {"field": "EventCountrySelected", "type": "nominal", "legend": null}
},
"layer": [
{"mark": "line"},
{
"params": [{
"name": "label",
"select": {
"type": "point",
"encodings": ["x"],
"nearest": true,
"on": "mouseover"
}
}],
"mark": "point",
"encoding": {
"opacity": {
"condition": {
"param": "label",
"empty": false,
"value": 1
},
"value": 0
}
}
}
]
},
{
"transform": [{"filter": {"param": "label", "empty": false}}],
"layer": [
{
"mark": {"type": "rule", "color": "gray"},
"encoding": {
"x": {"type": "temporal", "field": "Year_formatted", "aggregate": "min"}
}
},
{
"encoding": {
"text": {"type": "quantitative", "field": "Index Score"},
"x": {"type": "temporal", "field": "Year_formatted"},
"y": {"type": "quantitative", "field": "Index Score"}
},
"layer": [
{
"mark": {
"type": "text",
"stroke": "white",
"strokeWidth": 2,
"align": "left",
"dx": 5,
"dy": -5
}
},
{
"mark": {"type": "text", "align": "left", "dx": 5, "dy": -5},
"encoding": {
"color": {"type": "nominal", "field": "EventCountrySelected"}
}
}
]
}
]
},
{
"mark": {"type": "text", "align": "center", "fontWeight": "bold", "fontSize": 10, "dy": 15},
"encoding": {
"x": {
"field": "Year_formatted",
"type": "temporal"
},
"y": {
"field": "Index Score",
"type": "quantitative"
},
"text": {"field": "Event Name", "type": "nominal"},
"color": {"value": "black"}
}}
]
}
Thanks for the wisdom.
Hi @veronica_zappp ,
Please refer to these similar threads, hope these are helpful.
Solved: Visualisations blank until something selected in a...
Solved: Visual blank until filter selected
powerbi - Hide a visual until slicers are selected in power BI
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Sorry, this did not help.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |