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

Join 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.

Reply
Anonymous
Not applicable

Possibility of adding a dropdown in formate pane

we are developing a powerbi custom visual where we are trying to change the visual's content based on a drop down selection. We came across powerbi capabilities and noticed that we could add ValueTypeDescriptor | StructuralTypeDescriptor ( which are basically input boxes or color fill ). Is there any possibility of adding a drop down from where the user can choose from pre-defined inputs.

 

Please refer the image to understand where we are trying to add the drop down list.

 

question.PNG

I tried using couple of Visuals where I found drop down. But I couldn't figure out how to implement it. Please refer the below images.

Visual name - Multi row card. It had a drop down for font size

dd1.PNG

Visual Name - Map Which had a map type selection drop down

dd2.PNG

 

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @Anonymous,

The data type you want for generic lists is enumeration. Amazingly, I didnt realise the doc doesn't seem to have this listed, which is quite unhelpful and probably why you're stuck... however, the API typings do list them. Here's a link to the current master branch where they're listed, but you can check your local powerbi-visuals-api module typings.

Let's say you want a simple list, with two values. The syntax would be as follows:

...
"type": {
    "enumeration": [
        {
            "displayName": "One",
            "value": "one"
        },
        {
            "displayName": "Two",
            "value": "two"
        }
    ]
}
...

So, the value displayed to the user is the displayName property and the value you would access in your code is the value property. You can also add displayNameKey properties if you're using the localisation manager.

For a font list, there's a pre-defined type called fontFamily, which will generate a list of the supported fonts for you, e.g.:

"type": {
    "formatting": {
        "fontFamily": true
    }
}

Feel free to have a look into one of my visuals for examples of some of the others - hopefully you might find these useful.

Note that you can't currently dynamically create entries in lists; they have to be defined in the capabilities to appear. You also can't add measures to dropdowns yet like the core visuals can 😞

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


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 data type you want for generic lists is enumeration. Amazingly, I didnt realise the doc doesn't seem to have this listed, which is quite unhelpful and probably why you're stuck... however, the API typings do list them. Here's a link to the current master branch where they're listed, but you can check your local powerbi-visuals-api module typings.

Let's say you want a simple list, with two values. The syntax would be as follows:

...
"type": {
    "enumeration": [
        {
            "displayName": "One",
            "value": "one"
        },
        {
            "displayName": "Two",
            "value": "two"
        }
    ]
}
...

So, the value displayed to the user is the displayName property and the value you would access in your code is the value property. You can also add displayNameKey properties if you're using the localisation manager.

For a font list, there's a pre-defined type called fontFamily, which will generate a list of the supported fonts for you, e.g.:

"type": {
    "formatting": {
        "fontFamily": true
    }
}

Feel free to have a look into one of my visuals for examples of some of the others - hopefully you might find these useful.

Note that you can't currently dynamically create entries in lists; they have to be defined in the capabilities to appear. You also can't add measures to dropdowns yet like the core visuals can 😞

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors