BLOGS BY TOPIC
BLOGS BY AUTHOR
BLOGS BY YEAR
The only significant change to Power BI for the November 2019 update is the introduction of conditional formatting for buttons, although there are exciting things now waiting in preview.
- The November 2019 update to Power BI
- Conditional formatting of button properties (this blog)
- Power BI features in preview as of November 2019
Posted by Andy Brown on 25 November 2019
You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.
Conditional formatting of button properties
Sometimes it's obvious what software does, but less obvious how you might actually use it. This is one such case!
Let's suppose that you've created a system whereby you click on a picture as below (there's one for each of our 3 environments):
Here we've gone for showing watery data.
This then takes the user to a report page showing this environment's data:
You could use bookmarks to show the data and picture for the environment chosen.
However, you want the text, formatting and tooltip of the button to reflect the environment chosen:
What you want the button to look like if you choose the water environment, for example.
Creating the table of choices
One way to achieve this would be to add a couple of columns to your environment table:
Specify the colour and tool tip for each environment (the tooltip will serve as the button text also).
Now create a button:
This button has text entered against it, and a white background.
Choose to add conditional formatting to the Button Text property of your button:
Hover over the button's Button Text property and the tell-tale three vertical dots will appear - click on these to apply conditional formatting.
You could then specify that the button text should be the value of the Tool tip column in the environment table:
Use the Tool tip column for each environment to specify what text the button should display.
You could test this out using a quick slicer:
Change the environment and the button text should update.
The Button Text property will show an expression symbol:
The fx text shows that the button text is set to a conditional expression.
You could now do the same thing for the tooltip for the button:
You could set the tool tip to be the same expression as the title.
Likewise you could set the fill colour of the button to be dynamic:
Set the fill colour to be conditionally formatted.
You could then set the background colour to be the value of the Colour column you've added:
Set the fill colour to be the value of the Colour column.
Here's a quick test of this:
If you choose the LAND environment you should see a green fill colour, for example.
Properties you can conditionally format
Here's a list of the parts of a button which you can dynamically format like this:
- The button text font colour, as well as the button text itself
- The icon's line colour
- The button's outline line colour
- The button's fill colour (as above)
- The button's tooltip (as above)
I've taken a long time explaining this, but really this feature just adds to the set of properties for which you can set conditional formatting.