The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
12 | |
9 | |
7 |