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, in below table, I would like to have a category column with below conditions:
1. If No. is same, Type is same, then outcome follow Type string
2. If No. is same, Type is different, then outcome will be "Mix"
No. | Type | Desired Outcome |
010724120026 | EUD | EUD |
010724120026 | EUD | EUD |
010724120026 | EUD | EUD |
010724230815 | Non-EUD | Non-EUD |
010724230815 | Non-EUD | Non-EUD |
010724230815 | Non-EUD | Non-EUD |
250624070814 | EUD | Mix |
250624070814 | Non-EUD | Mix |
250624070814 | EUD | Mix |
Thanks.
Regards,
LC
Solved! Go to Solution.
@Tan_LC , You can create a calculated column for this
Category =
VAR CurrentNo = 'YourTableName'[No]
VAR CurrentType = 'YourTableName'[Type]
VAR TypeCount = CALCULATE(
COUNTROWS('YourTableName'),
ALLEXCEPT('YourTableName', 'YourTableName'[No]),
'YourTableName'[Type] <> CurrentType
)
RETURN
IF(TypeCount > 0, "Mix", CurrentType)
Proud to be a Super User! |
|
@Tan_LC , You can create a calculated column for this
Category =
VAR CurrentNo = 'YourTableName'[No]
VAR CurrentType = 'YourTableName'[Type]
VAR TypeCount = CALCULATE(
COUNTROWS('YourTableName'),
ALLEXCEPT('YourTableName', 'YourTableName'[No]),
'YourTableName'[Type] <> CurrentType
)
RETURN
IF(TypeCount > 0, "Mix", CurrentType)
Proud to be a Super User! |
|
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |