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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
I have below table as input
id|type
1|manager
1|non manager
1|manager
1|non manager
1|non manager
1|manager
desired output: if more than one id falling into manager and non manager hen it should show as mixed as shown below.
id|type
1|mixed
Can anyone help ..
Solved! Go to Solution.
Hi @Anonymous,
do you need SQL or DAX?
If SQL, you can use following query:
SELECT
id,
CASE WHEN COUNT(DISTINCT type) > 1 THEN 'mixed' ELSE MIN(type) END "Type"
FROM YourTable
GROUP BY ID
Hi @Anonymous,
do you need SQL or DAX?
If SQL, you can use following query:
SELECT
id,
CASE WHEN COUNT(DISTINCT type) > 1 THEN 'mixed' ELSE MIN(type) END "Type"
FROM YourTable
GROUP BY ID
You should try using a case when switch in sql counting the number of unique type if it is highter than one then mixed
| User | Count |
|---|---|
| 53 | |
| 41 | |
| 31 | |
| 26 | |
| 24 |
| User | Count |
|---|---|
| 134 | |
| 111 | |
| 57 | |
| 44 | |
| 37 |