Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Good afternoon,
I have a table with 25 columns to identify different diagnosis codes. I would like to create a custom column that flags whether any of the diagnosis codes (180) in another table are in any of those 25 fields. Is there a DAX statement or any other way that can help me accomplish that task in Power BI?
Thanks in advance for your help!
Solved! Go to Solution.
Trying to flag the Trigger Diags sounds like? Something along these lines should work. You would add this as a calculated column on the Claim table.
Trigger_Diagnosis =
SWITCH (
TRUE(),
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code1] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code2] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code3] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code4] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code5] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code6] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code7] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code8] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code9] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code10] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code11] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code12] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code13] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code14] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code15] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code16] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code17] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code18] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code19] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code20] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code21] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code22] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code23] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code24] ) ), "Y"
)
Hi @pbianalyst ,
Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your problem.
Best Regards,
Stephen Tao
Trying to flag the Trigger Diags sounds like? Something along these lines should work. You would add this as a calculated column on the Claim table.
Trigger_Diagnosis =
SWITCH (
TRUE(),
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code1] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code2] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code3] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code4] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code5] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code6] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code7] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code8] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code9] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code10] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code11] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code12] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code13] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code14] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code15] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code16] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code17] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code18] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code19] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code20] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code21] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code22] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code23] ) ), "Y",
NOT ISBLANK ( LOOKUPVALUE ( Trigger_Diag[Diagnostic_Code], Trigger_Diag[Diagnostic_Code], Claim[Diagnostic_Code24] ) ), "Y"
)
Thanks so much for your help and quick response. I will definetely try your solution.