Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.