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! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 88 | |
| 82 | |
| 68 | |
| 64 |