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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.