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
Coryanthony
Helper III
Helper III

Help with Calculated Column, Switch TRUE. PLEASE

Hello,

I have what i thought was a basic calculated column, but having issues that i can't explain or figure out. Please please help.

 
Threshold = SWITCH(TRUE(),
[Total Cash Claim] > 3000 && 'Cash Claims'[Employee Custom 11 - Name] = "Partner", "Partner",
[Total Cash Claim] > 1000 && 'Cash Claims'[Employee Custom 11 - Name] <> "Partner", "Employee", "NO")
 
Column description - If [Total Cash Claim] is > 3000 && [Employee Custom 11 - Name] = "Partner", then i want text to be "Partner"
                                   If [Total Cash Claim] is > 1000 && [Employee Custom 11 - Name] does not = "Partner", then i want text to                                         be "Employee", IF not, then "NO"
 
WHen i place this column in a table, it is not displaying the correct result, additionally, it is changing the [Total Cash Claim] results.
 
Please see Table A, i have the theshold column there but it changed the amount and also reporting "NO" rather than "Partner"
 
I cannot seem to figure this out. Please help. Thank you
Coryanthony_0-1695170377955.png

 

 
 
3 REPLIES 3
Coryanthony
Helper III
Helper III

@amitchandak 

I just watched you vidro and it was awesome. I should be able to make it with a measure.

But if i wanted the calculated column, what would be the best approach? 

amitchandak
Super User
Super User

@Coryanthony , The below will work only with [Total Cash Claim] is not a measure.

 

Threshold = SWITCH(TRUE(),
[Total Cash Claim] > 3000 && 'Cash Claims'[Employee Custom 11 - Name] = "Partner", "Partner",
[Total Cash Claim] > 1000 && 'Cash Claims'[Employee Custom 11 - Name] <> "Partner", "Employee", "NO")

 

If [Total Cash Claim] is measured then you need a measure and dynamic Segmentation

 measure

 

Threshold = SWITCH(TRUE(),
[Total Cash Claim] > 3000 && max('Cash Claims'[Employee Custom 11 - Name]) = "Partner", "Partner",
[Total Cash Claim] > 1000 &&max('Cash Claims'[Employee Custom 11 - Name])  <> "Partner", "Employee", "NO")

 

 

 

example

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://youtu.be/EyL7KMw877Q

Hi @amitchandak 

I did try eliminating the measure and while that did not change the amount, the logic was not accurate. I was not getting any "NO". If under the amounts i was still getting TRUE. Please see example below. 

I also want to count the amount of "Partner" and "Employee"; therefore, i was hoping to get this in a column.

 

Threshold = SWITCH(TRUE(),
SUM('Cash Claims'[Claimed Amount (rpt)]) > 3000 && 'Cash Claims'[Employee Custom 11 - Name] = "Partner", "Partner",
SUM('Cash Claims'[Claimed Amount (rpt)]) > 1000 && 'Cash Claims'[Employee Custom 11 - Name] <> "Partner", "Employee", "NO")
 
based on logic, highlighted should be "NO"
 
Coryanthony_0-1695186844981.png

 

 

I appreciate you so much. Thank you.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.