Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 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 All,
I've been following along the Guy in a Cube video to set up conditional highlighting, and I've run into a problem with my dax code:
Solved! Go to Solution.
Hi @Anonymous
You are missing the RETURN part, necessary when you use variables:
highlighting =
VAR _Source =
VALUES ( Highlight[Source] )
VAR _tohighlight =
SELECTEDVALUE ( 'Trend_data'[Source] )
VAR _Colour =
VALUES ( Highlight[HTML_Colour] )
VAR _filtered =
ISFILTERED ( Highlight[Source] )
VAR _result =
SWITCH (
TRUE,
NOT ( _filtered ), "#5BAF8D",
_tohighlight IN _Source
&& _filtered, "#5BAF8D",
_Colour
)
RETURN
_result
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Hi @Anonymous
You are missing the RETURN part, necessary when you use variables:
highlighting =
VAR _Source =
VALUES ( Highlight[Source] )
VAR _tohighlight =
SELECTEDVALUE ( 'Trend_data'[Source] )
VAR _Colour =
VALUES ( Highlight[HTML_Colour] )
VAR _filtered =
ISFILTERED ( Highlight[Source] )
VAR _result =
SWITCH (
TRUE,
NOT ( _filtered ), "#5BAF8D",
_tohighlight IN _Source
&& _filtered, "#5BAF8D",
_Colour
)
RETURN
_result
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
Ah!! I knew it would be something simple. Worked like a charm, thanks so much!!
User | Count |
---|---|
21 | |
20 | |
15 | |
10 | |
7 |
User | Count |
---|---|
28 | |
28 | |
12 | |
12 | |
12 |