Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
In which object are the rules stored that I created through the fx button? I want to apply those rules to the dataset that was returned by the wildcardselector. I wasn't able to find them in the DataView object
help is much appreciated
Thanks to this topic i was able to fix it:
https://community.fabric.microsoft.com/t5/Custom-Visuals-Development/Conditional-Formatting-createDa...
Thanks for the help, much appreciated
Hi @AnViL999,
The rules aren't accessible to the visual as the main window handles them; you only get the resulting value from the evaluated rules as in the appropriate location in the data view objects. MS does not expose more data from a report than a visual technically needs access to, so if you want the rules, you'll need to create an idea for it and hope that MS doesn't have any privacy concerns with supplying this information to a custom visual data view and is prepared to supply them. The alternative is to take the path other vendors have taken: add appropriate data roles and mappings for any dependent measures and handle the UI and logic for conditional formatting internally.
Regards,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hello @dm-p ,
Based on what you said I updated my capabilities.json file.
Whenever I select a subset that starts with a value that meets the rule the color changes. If not the default color is applied. What do I need to add in my update statement of somewhere else. So that for each dataPoint the rule is being evaluated and the correct color is being added?
For some reason I cannot correctly format the code:
Hi @AnViL999,
If you are now adding the value as a measure in the data view, it should be a case of retrieving it from the relevant location, assigning it to your view model, and performing the necessary logic there. I might approach this by:
However, where this will be depends on your data view and data role configuration, which isn't available in the above code. This snippet is presumably from your view model, which assumes you've already mapped it and doesn't give me any details on its lineage. As such, it would be good to know your dataRoles and dataViewMappings configuration, and the relevant parts of your mapping logic for your view model where you are trying to access it.
If you are still using conditional formatting after making capabilities changes and expect things to coexist somehow, then your formatting model logic will also need to be considered. Similarly, if you are using data-bound properties with a view to subbing in a measure. In that case, this further complicates analysis, as these are in different places in the data view depending on what selectors you are using and the type of data view mapping you have. In these cases it may be easier to make your entire visual available (or a suitable portion of it) as a resource that can be checked out and built/developed locally, with some example data and expected outcomes, as this will help diagnose and hopefully solve.
Cheers,
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
To add to my reply below:
and of course to have a default value if no filter is applied...
Hello @dm-p ,
Thank you for your reply.
I have sent you a private message with the source code.
It also contains a sample data set. What I am trying to achieve and which is partly working is showing the polygons, filtering based on the ID and showing the polygon based on if the Values column has the value 1. What I am now trying to achieve is to have a conditional formatting rule based on the Color_Rule column. For example 1 = green, 2 = blue, 3 = red. The conditional formatting part doesn't work... the color_rule column isn't mapped to the Values measure but on another column in the power bi dataset
kind regards,
AnViL
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.