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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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.

1 ACCEPTED SOLUTION
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.

View solution in original post

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
Impactful Individual
Impactful Individual

@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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.