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

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.

Reply
ShaikRafi
Frequent Visitor

DAX switch is not working

IF(HASONEVALUE('Marketing FTD'[Reporting Channel]),
IF(HASONEVALUE('Marketing FTD'[Team Reporting Channel]),

SWITCH( TRUE(),VALUES('Marketing FTD'[Reporting Channel])="Direct",

COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Reporting Channel]),[Marketing No of FTD1])),
VALUES('Marketing FTD'[Team Reporting Channel])="Direct",

COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[Marketing No of FTD1])),
COUNT('Marketing'[FTD_Count])

)
,COUNT('Marketing'[FTD_Count])
)
)

 

Above dax exp,I need to check both condition in switch but it working till first condition 

doubt:In switch if first condition is true then second is not check ?

4 REPLIES 4
amitchandak
Super User
Super User

@ShaikRafi , In switch, if the first condition is true it will not check second , you can use and or or

 

SWITCH( TRUE(),VALUES('Marketing FTD'[Reporting Channel])="Direct" && VALUES('Marketing FTD'[Team Reporting Channel])="Direct",

COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Reporting Channel]),[Marketing No of FTD1])),
VALUES('Marketing FTD'[Team Reporting Channel])="Direct",

COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[Marketing No of FTD1])),
COUNT('Marketing'[FTD_Count])

)
,COUNT('Marketing'[FTD_Count])
)
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

for me 

if VALUES('Marketing FTD'[Reporting Channel])="Direct" output COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Reporting Channel]),[Marketing No of FTD1]))

 

if  VALUES('Marketing FTD'[Team Reporting Channel])="Direct"

COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[Marketing No of FTD1]))

 

How can check both condition at time 

 

@ShaikRafi , in the same measure you can not return values at the same time. It can one return with && or || in if. Else one will come first 

 

Else add the results of two if

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

IF(
HASONEVALUE('Marketing FTD'[Reporting Channel]),
IF(
HASONEVALUE('Marketing FTD'[Team Reporting Channel]),

IF(VALUES('Marketing FTD'[Reporting Channel])="Direct",
COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Reporting Channel]),[Marketing No of FTD1])),

IF( VALUES('Marketing FTD'[Team Reporting Channel])="Direct" ,

COUNT('Marketing'[FTD_Count])+(SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[No of First Deposits])-SUMX(ALL('Marketing FTD'[Team Reporting Channel]),[Marketing No of FTD1])),

COUNT('Marketing'[FTD_Count]))
)

,COUNT('Marketing'[FTD_Count])
)
)

 

wrote query with if condition still working first part of condition not going to second condition

Can you please help

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.