Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a list with 532 rows. Those rows are splitted by months (like 200 rows as January, 200 rows as February and 132 rows as March).
What is the best way to add column with unique random number between 1 and 532?
I tried
Random = RANDBETWEEN( 1 , COUNTROWS(NETWORK_ORDER) )
But it generates duplicates.
What I want to achieve is to be able to randomly select 50 rows from each month.
I thought to generate this unique random value and them apply some filters.
What do you think?
Hi ,
You may try to use the INDEX column to get unique numbers.
Below is something that I came across in a blog. You can try doing it this way to get unique Random values.
In DAX, you can use RAND() function to generate random numbers. Similarly, to generate random numbers between two numbers, use RANDBETWEEN().
In Power Query, List.Random() creates a list of random numbers, while Number.Random() creates a single random number. You can add an index column before using the Number.Random() to get different random numbers on each row. You can delete the index column after the Number.Random() step. There isn't a List.RandomBetween() but Number.RandomBetween() can be used along with index column to generate numbers between two specified values.
Regards,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
102 | |
75 | |
43 | |
39 | |
31 |
User | Count |
---|---|
161 | |
87 | |
64 | |
46 | |
42 |