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.
In my capabilities.json I defind an object called color. I'm trying to define it inside my custom visual using :
startingColor: getValue<string>(options.dataViews[0].metadata.objects,'colors','startingColor',"#111111"),
Hello @Anonymous,
Power BI doesn't allow to get default color. However, you might define your own default color to return it to Power BI as a default.
You just need to apply your default color if there's no color in the metadata.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Can you please let me know how to do it? How can I check whether the metadata available or not?
Can you share implementation of getValue function that you use to get color from the metadata?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
I figured it out. Thanks. I'm using the condition if (options.dataViews[0].metadata.objects) to check whether the user has made any changes in the format pane or not.
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.
User | Count |
---|---|
9 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |