Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Need help to write a multi switch condition dax

Hello All,

 

Trying to create a traffic signal kpi.

For that i have two parameteres to calculate as below image.

 

ParameterRedAmberGreen
ContributionLess than 0%>0% and <10% of deal>= 10%
Billed Utilization<85%<92% and > 85%>=92%

 

First i have written Dax calculated column for only contribution condition as below

 

 

Traffic = SWITCH(TRUE(),
	Contri_Aug[Contri]<=0.00,"https://cdn3.iconfinder.com/data/icons/developperss/PNG/Red%20Ball.png",
    Contri_Aug[Contri]>=0.10,"https://cdn3.iconfinder.com/data/icons/developperss/PNG/Green%20Ball.png",
	Contri_Aug[Contri]>0.00 && Contri_Aug[Contri]<0.10,"https://cdn3.iconfinder.com/data/icons/developperss/PNG/Yellow%20Ball.png",
	
	BLANK())
    

It worked perfectly for me.

 

Then i have tried to write the same by including for builled utilization also as below.

 

Traffic2 = SWITCH(TRUE(),
	Contri_Aug[Cotnri]<=0.00 && [_BU]<0.85, "https://cdn3.iconfinder.com/data/icons/developperss/PNG/Red%20Ball.png",
    Contri_Aug[Contri]>=0.10 && [_BU]>=0.92,"https://cdn3.iconfinder.com/data/icons/developperss/PNG/Green%20Ball.png",
	Contri_Aug[Contri]>0.00 && Contri_Aug[Contri] < 0.10 && [_BU]<0.92 && [_BU]>0.85,"https://cdn3.iconfinder.com/data/icons/developperss/PNG/Yellow%20Ball.png",
	
	BLANK())

 

But it giving me wrong result.

 

Can anyone help me to get this done.

 

Thanks,

Mohan V

 

3 REPLIES 3
TomMartens
Super User
Super User

Hey,

 

you may try this

SWITCH(TRUE()
,AND(condition1, condition2), ...
,AND(condition1, condition2), ...
,AND(AND(condition1, condition2),condition3), ...
)

Hope this will help

 

Regards

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

Thanks for the quick reply @TomMartens.

 

I tryied this but the result is same as previous.Capture.PNG

Traffic2 = 
SWITCH(TRUE()
,AND(Contri_Aug[Contri]<=0.00 ,[_BU]<0.85), "https://cdn3.iconfinder.com/data/icons/developperss/PNG/Red%20Ball.png"
,AND(Contri_Aug[Contri]>=0.10, [_BU]>=0.92), "https://cdn3.iconfinder.com/data/icons/developperss/PNG/Green%20Ball.png"
,AND(AND(AND(Contri_Aug[Contri]>0.00, Contri_Aug[Contri]<0.10),[_BU]<0.92),[_BU]>0.85), "https://cdn3.iconfinder.com/data/icons/developperss/PNG/Yellow%20Ball.png"
)
    

 

 

 

Anonymous
Not applicable

Hi @Anonymous,

 

If you can, please provide the pbix file with sample data for further testing.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors