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
Koritala
Helper IV
Helper IV

Difference b/w Normar Switch & Switch with TURE()

Hi,

May I know the Difference b/w a Normal Switch & switch with TURE()? in DAX

Which one is the optimistic?

Thanks,

Srinivas.

3 REPLIES 3
V-yubandi-msft
Community Support
Community Support

Hi @Koritala ,
Could you let us know if your issue has been resolved or if you are still experiencing difficulties? Your feedback is valuable to the community and can help others facing similar problems.

V-yubandi-msft
Community Support
Community Support

Hi @Koritala ,

Thank you for reaching out to the Fabric Community. @GeraldGEmerick  provided a clear explanation. To add, the regular SWITCH() function is ideal when comparing a single value to several options, much like the CASE statement in SQL. On the other hand, SWITCH(TRUE()) offers more flexibility for checking multiple conditions and can help simplify logic compared to using many nested IF statements.

 

In terms of performance, there isn’t a significant difference between the two; the choice mainly depends on the complexity of your conditions and which method is easier to read and maintain.

 

Thanks for quick response @GeraldGEmerick .

 

Regards,
Yugandhar

GeraldGEmerick
Continued Contributor
Continued Contributor

@Koritala The "normal" SWITCH statement takes a value as the first parameter and then each pair of statements after that simply checks if that value equals the first value in the pair of statements and if so returns the second value in the pair of statements. For example:

SWITCH( 
  MAX( 'Table'[Color] ), //first parameter this is the value to check
  "Red", 1, // if the first parameter equals "Red" then return 1
  "Blue", 2 // if the first parameter equals "Blue" then return 2
  3  // otherwise, return 3 if the color is neither red or blue
)

 

SWITCH TRUE is a more flexible version where each pair of statements after the first parameter (TRUE) you can have a logical test which, if it evaluates to true, returns the corresponding value. For example:

SWITCH(
  TRUE(),
  MAX( 'Table'[Color] ) = "Red" && SUM( 'Table'[Value] ) < 100, 1,
  MAX( 'Table'[Color] ) = "Red" && SUM( 'Table'[Value] ) < 200, 2,
  3
)

 

 

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!

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.