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.
Hi,
I'm using the New Card visual to highlight some key metrics in my report. I'm using the Image and Divider dynamically to highlight changes in the results, as below:
To do this, I've had to create 2 separate measures - one fo the Icon/Image:
Dynamic Icon =
VAR Green = [Icons - Tick, Green]
VAR Yellow = [Icons - Circle, Yellow]
VAR Amber = [Icons - Circle, Amber]
VAR Red = [Icons - Exclamation, Red]
RETURN
IF([GDC - Guide Dog Waitlist Average Wait in Weeks] >= 30, Red,
IF([GDC - Guide Dog Waitlist Average Wait in Weeks] >= 25, Amber,
IF([GDC - Guide Dog Waitlist Average Wait in Weeks] >= 21, Yellow,
Green)))
And one for the Colour:
Dynamic Colours =
VAR Green = [Colour - Green]
VAR Yellow = [Colour - Yellow]
VAR Amber = [Colour - Amber]
VAR Red = [Colour - Red]
RETURN
IF([GDC - Guide Dog Waitlist Average Wait in Weeks] >= 30, Red,
IF([GDC - Guide Dog Waitlist Average Wait in Weeks] >= 25, Amber,
IF([GDC - Guide Dog Waitlist Average Wait in Weeks] >= 21, Yellow,
Green)))
To get the colours and icons I want, I've created separate measures to hold these, that I can use across all of my icon and colour measures.
I have a lot of these. There's a chance that if something needs to be changed in one metric, that it won't be carried onto the other. I want to know if there's a way to combine these 2 measures into one so it can be used for the Image and Divider Colour?
Any thoughts on how I could do this, if it's possible?
Ta,
Mark
Hi @Mark_Holland_GD - Yes! You can combine both the Dynamic Icon and Dynamic Colours measures into a single measure that returns a table with both values. This way, you only need to maintain one measure and reference it wherever needed.
Dynamic Icon & Colour =
VAR GreenIcon = [Icons - Tick, Green]
VAR YellowIcon = [Icons - Circle, Yellow]
VAR AmberIcon = [Icons - Circle, Amber]
VAR RedIcon = [Icons - Exclamation, Red]
VAR GreenColour = [Colour - Green]
VAR YellowColour = [Colour - Yellow]
VAR AmberColour = [Colour - Amber]
VAR RedColour = [Colour - Red]
VAR WaitWeeks = [GDC - Guide Dog Waitlist Average Wait in Weeks]
RETURN
SWITCH(
TRUE(),
WaitWeeks >= 30, UNICHAR(128165) & "|" & RedColour, -- Red Exclamation
WaitWeeks >= 25, UNICHAR(128993) & "|" & AmberColour, -- Amber Circle
WaitWeeks >= 21, UNICHAR(128993) & "|" & YellowColour, -- Yellow Circle
UNICHAR(9989) & "|" & GreenColour -- Green Tick
)
check the above logic andlet know.
Proud to be a Super User! | |
Hi @rajendraongole1 ,
I've created the following measure, replacing UNICHAR with the Icon URL variables:
Total Active Clients Vs Target - Icon/Colour =
//Icons
VAR GreenIcon = [Icons - Tick, Green]
VAR YellowIcon = [Icons - Circle, Yellow]
VAR AmberIcon = [Icons - Circle, Amber]
VAR RedIcon = [Icons - Exclamation, Red]
//Colours
VAR GreenHex = [Colour - Green]
VAR YellowHex = [Colour - Yellow]
VAR AmberHex = [Colour - Amber]
VAR RedHex = [Colour - Red]
//Metric
VAR Metric = [Total Active Clients]
RETURN
SWITCH(
TRUE(),
Metric >= 1500, GreenHex & "|" & GreenIcon,
Metric >= 1450, YellowHex & "|" & YellowIcon,
Metric >= 1400, AmberHex & "|" & AmberIcon,
RedHex & "|" & RedIcon)
It's working for the divider but for the Image URL field on the New Card Visual. Any idea what I should change so the Image URL appears too?
@rajendraongole1 it seems as if it's only recognising the variable before "|". When I swap these around to have the Image variables first, I can see the image but the divider isn't showing any colour.
How can we get both to show?
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.
User | Count |
---|---|
85 | |
74 | |
63 | |
39 | |
38 |