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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How can I change this IF() dax to SWITCH()

Measure =
IF([Value] <= 0.05,1,
IF([Value] > 0.05  &&  [Value] <= 0.15, 2,
IF([Value] > 0.15  &&  [Value] <= 0.25, 3,
IF([Value] > 0.25  &&  [Value] <= 0.5, 4,
IF([Value] > 0.5, 5, 0
)))))

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@Anonymous 

Like this:

Measure = SWITCH(
              TRUE(),
              [Value] <= 0.05, 1,
              [Value] > 0.05  &&  [Problem Occurence %] <= 0.15, 2,
              [Value] > 0.15  &&  [Value] <= 0.25, 3,
              [Value] > 0.25  &&  [Value] <= 0.5, 4,
              [Value] > 0.5, 5, 0 )

View solution in original post

1 REPLY 1
rsbin
Super User
Super User

@Anonymous 

Like this:

Measure = SWITCH(
              TRUE(),
              [Value] <= 0.05, 1,
              [Value] > 0.05  &&  [Problem Occurence %] <= 0.15, 2,
              [Value] > 0.15  &&  [Value] <= 0.25, 3,
              [Value] > 0.25  &&  [Value] <= 0.5, 4,
              [Value] > 0.5, 5, 0 )

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.