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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
garrettmindrup
Frequent Visitor

Assign Random Number For Each Distinct Item

Hello, 

I have a table with document numbers and $ amounts. Some document numbers have multiple amounts, so those numbers repeat within the table. 
I'd like to assign random numbers to each distinct document number. Is there a way to do a FOREACH() type formula that will assign the RAND() function to each distinct value in my document number column? 

Example Output:

Rand()Doc Number$ Amount
.9921100
.992189
.87622000
.653341
.6533200
1 ACCEPTED SOLUTION
garrettmindrup
Frequent Visitor

I think my solution is to pull in the document numbers into a separate table, remove duplicates, assign random numbers, and then create a relationship between the distinct table and the table with duplicates. Still open to other ideas if someone has a better solution. 

View solution in original post

2 REPLIES 2
garrettmindrup
Frequent Visitor

I think my solution is to pull in the document numbers into a separate table, remove duplicates, assign random numbers, and then create a relationship between the distinct table and the table with duplicates. Still open to other ideas if someone has a better solution. 

garrettmindrup
Frequent Visitor

Bump

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.