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! Learn more
Good Morning 🙂
I am struggling with creating a column/conditional column
Conditions:
● BD: TR Type = CRD, TR Code = 123, BK Trx # = 41, TR Text Does Not Contain "DCD"
● MD: TR Type = CRD, TR Code = 123, BK Trx # = 41, TR Text Contains "DCD"
● LD: TR Type = CD, TR Code = 125, BK Trx # = 54
● BMDS: TR Type = CD, TR Code = 123, BK Trx # has more than 6 digits (excl. leading zeros)
I have tried to do a custom column in Power Query is there any other method to achieve what I am trying to do.
| TR Type | TRCode | BKTrx # | TR Text |
| CRD | 456 | 1.91E+13 | ST |
| CRD | 123 | 41 | DCD |
| CRD | 123 | 41 | DCD |
| CRD | 123 | 1 | DCD |
| CRD | 123 | 41 | DCD |
| DBT | 123 | 1 | DCD |
| DBT | 123 | 41 | DCD |
Here is a sample data set.
@nniphadk That would be one long, nasty if statement in Power Query. DAX might be cleaner:
Column =
SWITCH(TRUE(),
[TR Type] = "CRD" && [TR Code] = 123 && [BK Trx #] = 41 && NOT(CONTAINSSTRING([TR Text], "DCD")), "BD",
[TR Type] = "CRD" && [TR Code] = 123 && [BK Trx #] = 41 && CONTAINSSTRING([TR Text], "DCD"), "MD",
[TR Type] = "CRD" && [TR Code] = 123 && [BK Trx #] = 54, "LD"
)
If you can provide sample data as text in a table, could be more complete with the solution. The last case is going to be similar although the leading zeros could be an issue. Are there a constant number of leading zeros or is it variable?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 38 | |
| 31 | |
| 30 |