Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
Hello,
My database looks like that
| ID | Status |
| ID1 | A |
| ID1 | A |
| ID1 | A |
| ID2 | A |
| ID2 | A |
| ID3 | A |
I would like to just create a random 0 1 column for each ID (so if ID got 1, it needs to have 1 in every row, same with 0).
Expected result
| ID | Status | NewBinaryColumn |
| ID1 | A | 1 |
| ID1 | A | 1 |
| ID1 | A | 1 |
| ID2 | A | 0 |
| ID2 | A | 0 |
| ID3 | A | 1 |
I have like 500k of distinct ID's. How to get such column?
Thank you in advance
Solved! Go to Solution.
You could do this in Power Query. Make a second query which references your original query, remove all columns other than the ID and then remove duplicate values. Add a new column which is
Number.Round( Number.RandomBetween(0,1) )
and then join this table back onto the original table
You could do this in Power Query. Make a second query which references your original query, remove all columns other than the ID and then remove duplicate values. Add a new column which is
Number.Round( Number.RandomBetween(0,1) )
and then join this table back onto the original table
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 76 | |
| 37 | |
| 31 | |
| 27 | |
| 27 |