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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Is it possible to hide dataroles from objects in capabilities

I am developing a cumstom visual. 

So I have a list of dataRoles shown in the Fields

2019_07_15_15_17_44_Power_BI.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Then I have objects in my Format section:

2019_07_15_15_20_56_Power_BI.png

 

So my question is, by switch True/false in Show benchmark, is it possible to show/hide the Benchmark measure in my Fields section?

 

Thanks.

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @Anonymous 

The configuration around dataRoles is fairly simple, in that you prescribe the fields available, and then you define how these fields map to the dataView (dataViewMappings). There's nothing in the schema for their configuration to suggest you can conditionally show/hide them.

Just my opinion, but I would agree with this, as your user should be able to understand what fields they can supply to the visual without too much further reading, and selectively hiding them may block their ability to utilise any functionality that depends on them later on; they may not remember about it if they toggle a setting they didn't think they needed initially. What if they hand this report on to someone else, who hasn't seen the visual before? They won't know that they can add more fields to the visual to improve its functionality.

If your user opts to not supply these fields then it shouldn't matter; they or other users working with thtem will know they can supply them later if they want to.

A more useful feature would be to toggle availability of the appropriate benchmark settings in the properties pane depending on their selected value. This is a more user-centric design pattern for custom visuals.

Maybe not the answer you're looking for, but will keep your visual in-line with the "Power BI" way of doing things. If it's still a feature you're looking for, then I'd suggest creating an idea for it.

Good luck!

Daniel

 

P.S. As a small aside, I noticed you were using enums for your true/false values. Similarly, toggles may be more beneficial for the end user and they make your code easier to manage if you do opt to manage show/hide of dependent properties later on. If you set the property as follows for these true/false values, then you will get toggles rather than dropdowns:

"type": {
    "bool": true
}

And then set the corresponding setting.ts property to type boolean.

e.g.:

image.png

 





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)




View solution in original post

1 REPLY 1
dm-p
Super User
Super User

Hi @Anonymous 

The configuration around dataRoles is fairly simple, in that you prescribe the fields available, and then you define how these fields map to the dataView (dataViewMappings). There's nothing in the schema for their configuration to suggest you can conditionally show/hide them.

Just my opinion, but I would agree with this, as your user should be able to understand what fields they can supply to the visual without too much further reading, and selectively hiding them may block their ability to utilise any functionality that depends on them later on; they may not remember about it if they toggle a setting they didn't think they needed initially. What if they hand this report on to someone else, who hasn't seen the visual before? They won't know that they can add more fields to the visual to improve its functionality.

If your user opts to not supply these fields then it shouldn't matter; they or other users working with thtem will know they can supply them later if they want to.

A more useful feature would be to toggle availability of the appropriate benchmark settings in the properties pane depending on their selected value. This is a more user-centric design pattern for custom visuals.

Maybe not the answer you're looking for, but will keep your visual in-line with the "Power BI" way of doing things. If it's still a feature you're looking for, then I'd suggest creating an idea for it.

Good luck!

Daniel

 

P.S. As a small aside, I noticed you were using enums for your true/false values. Similarly, toggles may be more beneficial for the end user and they make your code easier to manage if you do opt to manage show/hide of dependent properties later on. If you set the property as follows for these true/false values, then you will get toggles rather than dropdowns:

"type": {
    "bool": true
}

And then set the corresponding setting.ts property to type boolean.

e.g.:

image.png

 





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
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.