Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi there,
I am working on custom visual and I want to generate values of enumeration object dynamiclly bassed on measures name. below is my object structure in capabilities.json file.
"formatSettings": { "displayName": "Format Measures", "properties": { "measureLists":{ "displayName": "Measures List", "type": { "enumeration": [] } } } }
I tried adding dynamic values in enumeration object with below code but it is not working.
public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstance[] | VisualObjectInstanceEnumerationObject { let settings: VisualObjectInstance[] = (VisualSettings.enumerateObjectInstances(this.settings || VisualSettings.getDefault(), options) as VisualObjectInstanceEnumerationObject).instances; console.log(settings); switch(options.objectName){ case "formatSettings":{ settings.push({ objectName: options.objectName, properties:{ measureList: ['test', 'test2'] }, selector: null }); } } return settings; }
I am unable to find proper documentation regarding how to achive this. If someone has successfully implemented this, please share the solution with me.
Thank you.
Dynamic enumerations are not supported yet.
We'll update this thread once it's supported (not ETA so far).
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Is there any update on this? I see this works fine on the inbuilt visuals.. This feature would be great to have, especially when trying to change properties per element. Is there any workaround you would recommend currently?
There's no workaround for this issue. It's on backlog but there's no ETA because it will require a very redesign in how Power BI handles capabilities.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
If this feature isn't supported and there's no ETA, why is there a tutorial document for it?
https://github.com/Microsoft/PowerBI-visuals/blob/master/Tutorial/DataBoundObjects.md
Hi @scriptpup - this is not quite the same thing. You have always been able to generate properties at the top-level using the technique linked in the example.
The question is referring to dynamically changing the values in properties with dropdown values (enumerations). A use case for this is where you might have multiple measures in your visual and you want to have dynamic selection of properties, for example, in the the core matrix visual's Field formatting menu, e.g.:
Each entry has its own distinct set of properties that show/hide based on the selected measure.
These have to be manualy defined in custom visuals and cannot work dynamically like the above.
A lot of us would really like this feature, and have used the article you've linked as a (somewhat undesirable) workaround in some cases.
I hope that this clarifies the question OP is asking.
Regards,
Daniel
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)
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!