cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
hsavy
Frequent Visitor

Deneb - Independent Y-Axis Field on a facetted plot

Hello everyone, 

I need you help to make y-axis coherent to the facetted plot I am doing (Deneb). 

I facet a graph upon differents Products, with independant and differents Versions (y-axis) for each product. The issue is that Products are displayed according to versions of all product shown, and not only the one intended. Here he two screen of my deneb : 

hsavy_0-1674809583124.png           2   hsavy_1-1674809587173.png


When only one Product is filtered, version are shown correctly. But when I filter multiples products, each product is displayed according to the sum of versions of all products, which make it unreadable. 
Could you help me figure out how to make it work as I need ? 

Thanks everyone that's is going to help. 

@giammariam  @ppm1 @lbendlin, I ping you as you helped me at the beginning of the project, maybe you could also help here 😉 

1 ACCEPTED SOLUTION

Thanks @hsavy, is this more of what you're after? I simply updated the resolve to set the scale as independent, as opposed to the axis. Let me know if you're trying to do something else.

"resolve": {"scale": {"y": "independent"}}



Vega Editor Gist 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

View solution in original post

13 REPLIES 13
giammariam
Super User
Super User

Hey @hsavy. I would look into resolve to get the scales to show as desired. If you could provide a santized .pbix file with some mock data and your deneb visual, it'd really help me to dive deeper into this. If that can't happen, could you provide your vega/vega-lite spec? Happy to help further. Also, thanks for the tag.



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

.txt / .pbix files are not supported, how could i gave you access to my vega-lite spec ? 
I will also give you some anonimized data to work with. 

You can also share your data with your spec. Please see this video.

https://www.youtube.com/watch?v=SQt1qv24BKY

 

Pat

Microsoft Employee
hsavy
Frequent Visitor

Hoosier always here to help ahha 

Issue On VegaLite hsave (github.com)

Vega Editor

Here is a gist containing the data and code. 
As you can see, Product 1 and Product2 are shown according to all versions. 
I would like to display product1 according to his versions and product2 according to his versions. 

Thank you guys


Thanks @hsavy, is this more of what you're after? I simply updated the resolve to set the scale as independent, as opposed to the axis. Let me know if you're trying to do something else.

"resolve": {"scale": {"y": "independent"}}



Vega Editor Gist 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Thanks again. I also tried to change the height of each facet according to the number of version. Do you think it's possible ?

I've tried with a calculate and with "height" : calculated_height, but it said it had to constant 😕 

@hsavy I believe so. Can you share the formula that you tried to implement for calculated_height? This may be doable by manipulating the y-scale output range values.

 

Or a better option is to probably use step for the height instead of a fixed value. See here and let me know.



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

@giammariam I couldn't find exactly what I've tried but it was something like : 
"transform" : [

    {"calcultate" : length("List_of_version"), "as" calculated_height}

]
But it couldn't work correctly in this version, rising the error : height as to be constant. 

When I try to put a step height in my facet spec, the error raising is "missing child_height signal". 

I am currently looking for an other solution 

@hsavy this was a tricky one. The layer inside the facet was throwing things off. The way the underlying Vega works, it wasn't recognizing the auto-generated signal called child_height. The solution was to create a param with the name, child_height. To avoid confusion, I didn't give the param a value. To update the vertical step, update the step value inside the spec for the facet.

A bit of a hack, but it works. Glad I was able to discover this in case I ever run into this down the road with any of my projects.

Here is the gist

giammariam_0-1675694664603.png

 



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

What a solution :') 
Good job finding this one trick. Maybe you could post this as a bug on the vega-lite git. 
Thanks again, you're the goat 

Wow, that was that easy :') 
I may had some issue to different scale and axis as a non english speaker. 

Thanks for you help and quick answers. Really appreciate ! 

@ppm1, thanks for sharing this. I've seen many of Hoosier BI's videos before, but not that one. That simple function will not only make getting help with Deneb easier, but will also make development with realistic data outside of deneb and in the vega editor, faster.



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

How to provide data/pbix: https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

 

you can also share your spec by using the code tag under formatting. The icon looks like this: </>



Madison Giammaria
Proud to be a Super User 😄
LinkedIn

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.