The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
16 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
23 | |
13 | |
13 | |
8 | |
8 |