Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

Dynamically generate enumeration object

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": {
                    "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;
                case "formatSettings":{
                        objectName: options.objectName,
                            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. 

Community Champion
Community Champion

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

Frequent Visitor

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?

Community Champion
Community Champion

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?

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.



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

PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

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!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors