Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
smpa01
Super User
Super User

Randomly assigning a specific value to one of the rows

Hi,

 

Aplogies if this has been posted previously by me. I tried posting it twice and I got an error message in both occassions. Please ignore if this is already a duplication.

 

I am trying to achieve a task which involves randomly assigining value "2" to one of the rows only. Is it possible to achieve in PBI/Power Query (DAX- not preferred). I have a column called "E Address". For each of the "E Address" I want PBI to assign a 2 to only one of the rows randomly and rest of the rows would be 1.

 

Data set - https://drive.google.com/open?id=1OD9wh3I3onjGaOjtXZInF5F7SExBwP4u

 

Thank you in advance.

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION

Find solution here - http://community.powerbi.com/t5/Desktop/Randomly-assiginng-a-specific-value-to-one-of-the-rows/m-p/3...

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

2 REPLIES 2
vega
Resolver III
Resolver III

I don't believe that you can just change a value in PowerQuery from the dataset directly, for one row. You can replace a value in PowerQuery, but it will be all occurrences of a specific value. For example, you can say replace all instances of 0 in a specific column with the value 12.

Find solution here - http://community.powerbi.com/t5/Desktop/Randomly-assiginng-a-specific-value-to-one-of-the-rows/m-p/3...

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.