Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi,
I'm looking to create a customer column based on two columns in the same table.
If Column 1 contains a number (3 digits) and Column 2 is contains the same number , then I want to label it 'Direct'. If the digits in either column do not match, then label it 'Indirect'. The caveat is that on occassion, there may be data in column 1, but no data in column 2.
Any help would be appreciated!
Solved! Go to Solution.
Hi @Tob_P
Please refer to attached file with the solution
Output2 =
IF (
'Table'[Col 1] IN ALLNOBLANKROW ( 'Table'[Col 2] ),
IF (
'Table'[Col 1] = 'Table'[Col 2]
|| 'Table'[Col 2] = BLANK ( ),
"Direct",
"Indirect"
)
)
Hi @Tob_P
Please refer to attached file with the solution
Output2 =
IF (
'Table'[Col 1] IN ALLNOBLANKROW ( 'Table'[Col 2] ),
IF (
'Table'[Col 1] = 'Table'[Col 2]
|| 'Table'[Col 2] = BLANK ( ),
"Direct",
"Indirect"
)
)
Thanks @Anonymous
Apologies - I did not explain this well at all.
Col 1 | Col 2 | Output |
222 | 222 | Direct |
222 | 225 | Indirect |
222 | 227 | Indirect |
222 | Direct | |
227 | 222 | Indirect |
222 | Indirect | |
222 | 222 | Direct |
Working on the basis of code 222...
Ok. no probs. Try this :
User | Count |
---|---|
10 | |
8 | |
5 | |
5 | |
4 |