March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a demand to show the system's available status.
Here is the expected output below.
Due to some reasons, I must use 'shapes' to present the availability ( and seems this is the only way to do that ). As you can see the blue & red circles above, a green circle means good, and a red circle means something wrong.
Right now, all these 'shapes' and color are changed manually.
But what I need is that the circles able to change its color automatically based on values from the database table.
May I know how to change the shape's color based on the values? Thanks.
Solved! Go to Solution.
You can use create a measure that generates a SVG image of a circle. ease see sample pbix
Circle =
VAR __RAND =
ISODD ( SELECTEDVALUE ( 'Table'[Random] ) )
VAR _color =
IF ( __RAND, "red", "green" ) --replace with the desired color, you can use hex or RGB
VAR LeftPad = 0
VAR UpperPad = 5
VAR _Pad = LeftPad & ", " & UpperPad
VAR _circle = "<circle cx='50' cy='50' r='40' fill='" & _color & "' transform='translate(" & _Pad & ")' />"
VAR _vbSize = " 110 110 " -- reduce to increase circle size
VAR svg = "data:image/svg+xml;utf8," & "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 " & _vbSize & "'>" & _circle & "</svg>"
RETURN
svg
Proud to be a Super User!
Hi @DongdongYu
You can try below video for better understanding
https://www.youtube.com/watch?v=MGcYfCpwDds
https://www.youtube.com/watch?v=lfqPpUdtTss
https://www.youtube.com/watch?v=gCbBarkiH3c
https://www.youtube.com/watch?v=o2jSUHU722w
I hope combination of above videos will help you to resloved your issue!.
You should be able to use conditional formatting with icons.
Proud to be a Super User!
Thanks, but 'condition formatting' cannot change the dot size.
You can use create a measure that generates a SVG image of a circle. ease see sample pbix
Circle =
VAR __RAND =
ISODD ( SELECTEDVALUE ( 'Table'[Random] ) )
VAR _color =
IF ( __RAND, "red", "green" ) --replace with the desired color, you can use hex or RGB
VAR LeftPad = 0
VAR UpperPad = 5
VAR _Pad = LeftPad & ", " & UpperPad
VAR _circle = "<circle cx='50' cy='50' r='40' fill='" & _color & "' transform='translate(" & _Pad & ")' />"
VAR _vbSize = " 110 110 " -- reduce to increase circle size
VAR svg = "data:image/svg+xml;utf8," & "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 " & _vbSize & "'>" & _circle & "</svg>"
RETURN
svg
Proud to be a Super User!
You can use a method similar to the one described here: https://www.sqlbi.com/articles/creating-custom-visuals-in-power-bi-with-dax/
Basically, you will need to create a measure that returns a different colour / size of circle based on the values in your data - check the section called "Making the SVG dynamic with DAX"
Thanks, I'll try it.
I know I can use 'table' and apply 'condition formatting' to present the status, but unfortunately, in this way, I can't change the size and shape of the points. So I was wondering how can I use 'shape' to achieve my target.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
164 | |
116 | |
63 | |
57 | |
50 |