Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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.
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.
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
Visual Name - Map Which had a map type selection drop down
Solved! Go to Solution.
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
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
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
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.