Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello guys. Im trying to do a DAX command and I´m getting the following error.
What I´m trying to do is highlight teams based on their names (whenever I click one team, it will highlight it on a visual).
I will paste the DAX code and the error below:
Solved! Go to Solution.
It is what it is: you've got the syntax wrong. Head over to www.daxformatter.com, paste the code in there and let it check it. It'll show you where the problem is...
TeamToHighlight2 =
VAR _selectedteam =
VALUES( Teams_Highlight[Team Name] )
VAR _teamtohighlight =
SELECTEDVALUE( 'Premier League'[Team Name] )
VAR _filtered =
ISFILTERED( Teams_Highlight[Team Name] )
VAR _result =
SWITCH(
TRUE,
NOT ( _filtered ), "#0079EB",
_teamtohighlight
IN _selectedteam
&& _filtered, "0079EB",
"#99C9F7"
)
RETURN
_result
Thank you a lot for the help. I thought the solution was with the return clause but didn´t know what to return
It is what it is: you've got the syntax wrong. Head over to www.daxformatter.com, paste the code in there and let it check it. It'll show you where the problem is...
TeamToHighlight2 =
VAR _selectedteam =
VALUES( Teams_Highlight[Team Name] )
VAR _teamtohighlight =
SELECTEDVALUE( 'Premier League'[Team Name] )
VAR _filtered =
ISFILTERED( Teams_Highlight[Team Name] )
VAR _result =
SWITCH(
TRUE,
NOT ( _filtered ), "#0079EB",
_teamtohighlight
IN _selectedteam
&& _filtered, "0079EB",
"#99C9F7"
)
RETURN
_result
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.