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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Zack92
Helper III
Helper III

If condition is not working the way I want?

Hello, 

 

All I am trying to do is create a score based on their Support title and Assist Number, please see below for the condition. 

 

Support title = "Technical Support Engineer" then 2

Support title = "Advanced Technical Support Engineer" AND [Assists] >= 10 then 2

Support title = "Advanced Technical Support Engineer" AND [Assists] >= 5 then 1

Support title = "Senior Technical Support Engineer" AND [Assists] >= 20 Then 2

Support title = "Senior Technical Support Engineer" AND [Assists] >= 10 Then 1

 

So Tired of creating a Measure, but I can not give text on measure. So I have tried using the calculated column, but giving me the wrong Score. 

 

Can anybody please take a look at this? 

 

Sample Data

https://docs.google.com/spreadsheets/d/10QAt9qPBzADOFWWYm1J4AmikFu_72HJW/edit?usp=sharing&ouid=11599...

Sample File

https://drive.google.com/file/d/170NYKOZKosxup17g4-He1_IaFRoG9146/view?usp=share_link

 

Thank you so much 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Zack92 ,

 

Please try:

 

Column = 
SWITCH(
    TRUE(),
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Technical Support Engineer", 2,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Advanced Technical Support Engineer" 
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 5
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] < 10, 1,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Advanced Technical Support Engineer"
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 10, 2,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Senior Technical Support Engineer"
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 20, 2,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Senior Technical Support Engineer"
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 10
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] < 20, 1
) + 0

 

vcgaomsft_0-1672882562111.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@Zack92 Use a SWITCH(TRUE(),...) statement in a measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Thank you for taking a look at this.  I tried Switch statement and it did not work. Please see below for the sample code. 

Assist GD = SWITCH(
                TRUE(),
                    Closes_Assists_KB_NPS_ByMonthByManager[Support Title] = "Senior Technical Support Engineer" && SUM(Closes_Assists_KB_NPS_ByMonthByManager[Assists]) = 20, 2,0)

 

What I used to have 

Assist Grade = IF(Closes_Assists_KB_NPS_ByMonthByManager[Support Title] = "Technical Support Engineer", 1,
                    IF(Closes_Assists_KB_NPS_ByMonthByManager[Support Title] = "Advanced Technical Support Engineer" && Closes_Assists_KB_NPS_ByMonthByManager[Assists] >= 10, 2,
                        IF(Closes_Assists_KB_NPS_ByMonthByManager[Support Title] = "Advanced Technical Support Engineer" && Closes_Assists_KB_NPS_ByMonthByManager[Assists] >= 5, 1,
                            IF(Closes_Assists_KB_NPS_ByMonthByManager[Support Title] = "Senior Technical Support Engineer" && SUM(Closes_Assists_KB_NPS_ByMonthByManager[Assists]) >= 20, 1, 0))))

 

Again, thank you 

Anonymous
Not applicable

Hi @Zack92 ,

 

Please try:

 

Column = 
SWITCH(
    TRUE(),
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Technical Support Engineer", 2,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Advanced Technical Support Engineer" 
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 5
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] < 10, 1,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Advanced Technical Support Engineer"
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 10, 2,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Senior Technical Support Engineer"
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 20, 2,
    'Closes_Assists_KB_NPS_ByMonthByManager'[Support Title] = "Senior Technical Support Engineer"
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] >= 10
        && 'Closes_Assists_KB_NPS_ByMonthByManager'[Assists] < 20, 1
) + 0

 

vcgaomsft_0-1672882562111.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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