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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Griffin_BI
Frequent Visitor

RAND with PARTITIONBY

Hello,

I have a table with an ID column and three dimensions A, B and C. 

I would like to add a fourth column, a random number, evenly distributed throughout a partition of A, B and C.

 

Is this possible please?

Thank you.

 

1 REPLY 1
Anonymous
Not applicable

Hi, @Griffin_BI 

You can create a Custom Column in PowerQuery and use

=Number.RandomBetween(0,6)

vyohuamsft_1-1713319331031.png

 

The numbers in parentheses are a range of the numbers you want to random

 

vyohuamsft_0-1713319099700.png

Here is my preview in report view

vyohuamsft_2-1713319399968.png

You will get a different number with each refresh.

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.