Forum Discussion
Deneb - How to add measures on another dataset
Hi,
I want to replicate the sunburst example from Vega on my PBI here: https://vega.github.io/vega/examples/sunburst/
But, my values are not in a table, they are measures. So, I need to combine them on a hard-coded table and I'm getting this situation:
Deneb is importing all measures as a table, like this:
But, I need to create a dataset on Deneb like this:
Any ideas on how I can do this "merge"? I think that he is not getting the values because they are on another table, but I also tried methods to do a lookup or transform it in a signal but I was unsuccessful in both cases.
A couple things:
- You're missing the parent column. I created one based on the numbering of your IDs, although if you are going to stick with this type of hierarchy and eventually add more nodes, I'd consider handling the parent column separately. If you don't need this parent-child relationship visualized, feel free to delete the formula transform that I added to create the parent column.
- I moved all encodings to the update channel and that seemed to get the colors and tooltips working. Unless I want encodings to change in a particular way due to data binding changes, I'll usually always have everything in update.
9 Replies
- giammariamSolution Sage
Hey AlexandreCoutoB. Look into performing a fold transform on your original dataset to get them into key-value pairs. This will be more aligned to the table format you're looking for.
If this gets you moving, please consider kudoing this reply and choosing it as the solution. If not, I would be happy to help further. Please provide a sanitized .pbix (here's how) so I can look into this.
- AlexandreCoutoBFrequent Visitor
Hi giammariam ,
Thanks for your help, I tried this option, but I separated it into different datasets, then I "joined" them with a lookup and ended up with what I wanted. But for some reason, Vega does not recognize the values to use on tooltips or fill with a gradient.
I'm giving you some screenshots, but if it doesn't help, I'll try to generate a sanitized .pbix.
folded dataset:
final dataset:
tooltip and fill not working:
- giammariamSolution Sage
AlexandreCoutoB, at first glance, nothing jumps out as being off with what you've posted. I took my best guess at creating a spec somewhat similar to what you have (minus having multiple datasets).
Check out this gist. Maybe you can look at it against your spec and figure out where the disconnect is. If this doesn't help, then sharing a .pbix may be the best way forward.
- AlexandreCoutoBFrequent Visitor
Hi giammariam ,
I did this test too, and it works on Vega editor with a pre-built dataset, my problem is how to create this dataset on Deneb. It seems like it cannot get the field values after a lookup.
As Deneb brings me the measures in this format, I need to do all those transformations on the data until I get the final format required by Vega.
Take a look at my spec here, it's very close to what I did and didn't work on Deneb. I'm creating a sanitized .pbix in the meanwhile.