Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I am trying to create a column on a Sales table to identify if a serial number has had an Install, a Startup OR Install & Startup claim from a Claim table. The two tables are joined by the serial number. Below is sample data and the output I am looking for. I need to be able to be able to use this for a slicer to filter by units that had an Install, a Startup OR Install & Startup claim.
I am trying to get this done tonight and I am hoping someone can help me.
Thank you in advance!
Sales Table
| Serial # | Ship Date |
| Serial1 | 1/15/2018 |
| Serial2 | 11/15/2018 |
| Serial3 | 2/27/2019 |
| Serial4 | 1/28/2017 |
| Serial5 | 2/15/2018 |
| Serial6 | 7/26/2019 |
| Serial7 | 10/1/2019 |
| Serial8 | 1/2/2020 |
Claim Table
| Serial # | Claim # | Claim Type | Claim Date |
| Serial1 | Claim1 | Install | 2/1/2018 |
| Serial1 | Claim2 | Startup | 2/2/2018 |
| Serial1 | Claim3 | Warranty | 1/13/2019 |
| Serial2 | Claim4 | Install | 3/14/2019 |
| Serial3 | Claim5 | Warranty | 3/6/2019 |
| Serial4 | Claim8 | Startup | 3/5/2017 |
| Serial4 | Claim10 | Warranty | 12/21/2018 |
| Serial5 | Claim11 | Install | 3/12/2018 |
| Serial5 | Claim12 | Startup | 7/31/2018 |
| Serial5 | Claim13 | Warranty | 1/22/2019 |
Desired Output
| Serial # | Ship Date | Install/Startup |
| Serial1 | 1/15/2018 | Install & Startup |
| Serial2 | 11/15/2018 | Install |
| Serial3 | 2/27/2019 | |
| Serial4 | 1/28/2017 | Startup |
| Serial5 | 2/15/2018 | Install & Startup |
| Serial6 | 7/26/2019 | |
| Serial7 | 10/1/2019 | |
| Serial8 | 1/2/2020 |
Solved! Go to Solution.
Try this.
Column =
VAR A = RELATEDTABLE(Claim)
VAR INS = CALCULATE(COUNT(Claim[Claim #]),FILTER(A,Claim[Claim Type]="Install"))
VAR ST = CALCULATE(COUNT(Claim[Claim #]),FILTER(A,Claim[Claim Type]="Startup"))
RETURN SWITCH(
TRUE(),
INS > 0 && ST > 0,"Install & Startup",
INS > 0, "Install",
ST > 0, "Startup",
BLANK()
)
See below.
If it helps, mark it as a solution
Kudos are nice too
Try this.
Column =
VAR A = RELATEDTABLE(Claim)
VAR INS = CALCULATE(COUNT(Claim[Claim #]),FILTER(A,Claim[Claim Type]="Install"))
VAR ST = CALCULATE(COUNT(Claim[Claim #]),FILTER(A,Claim[Claim Type]="Startup"))
RETURN SWITCH(
TRUE(),
INS > 0 && ST > 0,"Install & Startup",
INS > 0, "Install",
ST > 0, "Startup",
BLANK()
)
See below.
If it helps, mark it as a solution
Kudos are nice too