cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
optimusprime Regular Visitor
Regular Visitor

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

Accepted Solutions
dm-p Established Member
Established Member

Re: Is it possible to hide dataroles from objects in capabilities

Hi @optimusprime 

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

 

1 REPLY 1
dm-p Established Member
Established Member

Re: Is it possible to hide dataroles from objects in capabilities

Hi @optimusprime 

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

 

Helpful resources

Announcements
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 5 members 1,223 guests
Recent signins:
Please welcome our newest community members: