Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ewaghabi
Frequent Visitor

How can a custom visual change grouping datarole fields order, as seen in decomposition tree viz?

I'm coding an hierarhical tree custom visual using matrix dataview mapping and want to change, at user's will and from within the custom visual, the order of the fields in the grouping datarole, as seen in the decomposition tree visual and also comercial ones like xViz's hierarchichal tree (https://xviz.com/visuals/hierarchical-tree/).

 

For instance, if you have this situation in the decomposition tree visual:

 

ewaghabi_0-1616694808317.png

 

After you choose 'Nível 4', the ACTUAL ORDER of the fields in the right pane is changed:

 

ewaghabi_1-1616694808307.png

 

My guess is that by doing this, my visual will receive a new matrix mapping tree with the recalculated nodes, but I haven't been able to figure out how to do so. I've tried changing the dataViews.matrix.rows.root directly and updating the visual but to no avail.

 

Again, it's a feature seen in comercial visuals so I'm guessing the current API allows it.

 

Thanks in advance.

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @ewaghabi ,

 

According to my experience, it is impossible to realize this idea in the current version. The order of the fields in the right window can only be adjusted manually.

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Not to go off-topic, but I always wonder how some commercial visuals seem to implement functionalities that are apparently not available in the current API. As to avoid speculation, I think it's best for me to assume there's a way...

 

For not, I think

Hi @ewaghabi,

There's only a single API for all third party visuals, including commercial - what you can do with your data roles depends on what your data view mapping exposes. As you're citing two closed-source visuals - one of them core - it's hard to tell exactly what they are doing without violating some ToS.

You may well be more limited with the matrix mapping in terms of what you can do. As a result, most visuals tend to use categorical and do more work when mapping the data.

In the case of the categorical mapping, Power BI will list the columns in their order in the corresponding categorical.categories object. If you're looking at objects.metadata, this is typically in the order they were added and this isn't much use for your scenario.

I don't work with the matrix data view mapping but my gut would tell me that if this is possible, the order of the objects in either the appropriate rows or columns object in the dataView might be what you need to work with here.

If you're willing to post more detail, including your capabiltities configuration then we might be able to see if there's a specific way to assist, but anything else is particularly difficult to debug from the detail in your original post. If not, hopefully some of this might be useful for you. Good luck!

Regards,

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.