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.
Hello guys, could we create trelli pie chart? And if not, is that possible to have the code to create this with Deneb module?
I have the same question for multiple Scatter plot .
Thanks a lot,
Jim
Solved! Go to Solution.
I coded the facets to dynamically handle the row/column layout, so adding/removing charts within reason should not be an issue.
Hey @JimmyCruyp. I implemented some changes and have a version working in Power BI.
You want to make sure that the Summarization for the Result field is set to Don't Summarize (see the below screenshot).
Note - you'll need to play with the radius percentages and the spec width and height based on the size of your visual (see below screenshot)
You can download a working .pbix here
It's awesome. But small question: if the users are not report creators and will not be able or will not have the authorizations to modify the code in Deneb, that means that the graph risks having a bad format? It does not automatically adapt in format according to the number of sector graphs we have? It is very disturbing though....
I coded the facets to dynamically handle the row/column layout, so adding/removing charts within reason should not be an issue.
You are a monster. Thanks a lot. Now I will need the same but for scatter chart. I will create a new post. Thanks superman
Hey Jim, this could certainly be done with Deneb. It could also be done with the native matrix and DAX generated SVGs (similar to your correlation matrix post).
The latter would be a bit tougher to pull off, so I'd recommend going with Deneb this time. If you provide some data, I'd be happy to crank out a vega-lite spec.
Type | Voice | Result |
A | Power | 10 |
A | Then | 5 |
A | Zeld | 32 |
A | Link | 8 |
A | Nintend | 2 |
A | Sega | 7 |
B | Power | 8 |
B | Then | 4 |
B | Zeld | 6 |
B | Link | 8 |
B | Nintend | 20 |
B | Sega | 52 |
C | Power | 9 |
C | Then | 13 |
C | Zeld | 25 |
C | Link | 2 |
C | Nintend | 2 |
C | Sega | 3 |
D | Power | 10 |
D | Then | 20 |
D | Zeld | 54 |
D | Link | 10 |
D | Nintend | 30 |
D | Sega | 10 |
E | Power | 3 |
E | Then | 65 |
E | Zeld | 9 |
E | Link | 24 |
E | Nintend | 35 |
E | Sega | 22 |
F | Power | 70 |
F | Then | 17 |
F | Zeld | 21 |
F | Link | 80 |
F | Nintend | 7 |
F | Sega | 10 |
G | Power | 9 |
G | Then | 90 |
G | Zeld | 20 |
G | Link | 20 |
G | Nintend | 100 |
G | Sega | 20 |
H | Power | 5 |
H | Then | 5 |
H | Zeld | 120 |
H | Link | 5 |
H | Nintend | 5 |
H | Sega | 75 |
I | Power | 33 |
I | Then | 130 |
I | Zeld | 33 |
I | Link | 1 |
I | Nintend | 0 |
I | Sega | 0 |
J | Power | 40 |
J | Then | 11 |
J | Zeld | 22 |
J | Link | 11 |
J | Nintend | 50 |
J | Sega | 24 |
K | Power | 3 |
K | Then | 7 |
K | Zeld | 60 |
K | Link | 21 |
K | Nintend | 12 |
K | Sega | 22 |
L | Power | 70 |
L | Then | 10 |
L | Zeld | 0 |
L | Link | 10 |
L | Nintend | 20 |
L | Sega | 80 |
M | Power | 30 |
M | Then | 22 |
M | Zeld | 25 |
M | Link | 1 |
M | Nintend | 140 |
M | Sega | 19 |
N | Power | 22 |
N | Then | 27 |
N | Zeld | 30 |
N | Link | 5 |
N | Nintend | 30 |
N | Sega | 6 |
O | Power | 22 |
O | Then | 33 |
O | Zeld | 8 |
O | Link | 9 |
O | Nintend | 38 |
O | Sega | 31 |
@JimmyCruyp, while I personally don't love pie charts, I do like your choice of dummy data 😀.
There's a lot that can be configured and formatted here, but I kept it simple. Let me know if you need any tweaks.
You should be able to copy the spec into Deneb. You'll want to drag in the Type, Voice, and Result fields into the data pane, and remove the url and format properties under the data property in the spec.
If this gets you going, please consider liking this reply and choosing it as the solution so others can find it. If you need additional help, just let me know.
spec:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"name": "dataset",
"url": "https://raw.githubusercontent.com/Giammaria/PublicFiles/master/pbi/pbi_community_help/trellis_pie/data/data.tsv",
"format": {"parse": {"Result": "number"}}
},
"transform": [
{"joinaggregate": [{"op": "distinct", "field": "Type", "as": "type_count"}]},
{"joinaggregate": [{"op": "sum", "field": "Result", "as": "result_total"}], "groupby": ["Type"]},
{"calculate": "toString(datum['Result'])+' out of '+toString(datum['result_total'])", "as": "result_out_of"},
{"calculate": "format(datum['Result']/datum['result_total'],'.0%')", "as": "percentage"}
],
"mark": {"type": "arc"},
"encoding": {
"facet": {
"field": "Type",
"type": "ordinal",
"columns": 5,
"sort": {"field": "Type"}
},
"theta": {"field": "Result", "type": "quantitative"},
"color": {"field": "Voice", "type": "nominal"},
"tooltip": [
{"title": "Voice", "field": "Voice"},
{"title": "Result", "field": "result_out_of"},
{"title": "Result %", "field": "percentage"}
]
}
}
Hi,
Is that possible to have also a bar to set the graphs dimension? As you have done for the multiple treilli? This could be great!!
Jim
Please make a new post and tag me with this request. I'd be happy to.
thanks a lot this looks great. But i dont see anything appearing in Power BI. Maybe because i dont have any configuration? Could you please provide me also the config? Sorry i am very bad at this.
I have added the 3 fields and remoove the url to obtain something starting with this : {
"data": {"name": "dataset"},
"transform":
Could you also please add a percentage in each pie per voice (legend)? fi
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.