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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Dicken
Post Prodigy
Post Prodigy

Non volatile random numbers between


Hi, 
is there a way to create a stablel random list bwtween, two numbers;     so a staable list  1 to 10  could be 

= List.Transform( 
 List.Random( 20,1), (x)=> 
   Number.IntegerDivide( ( x * 10  ) ,1 ) 
)

 the problem is this method always starts at  1   and i would like to cntrol the min and max vaulues,
what i woud like is stable version of   

 List.Transform( {1..100},(x)=>
let n = 
 Number.IntegerDivide( Number.RandomBetween( 97, 122),1)
 in 
 Character.FromNumber(n) )

 any suggestions, 

Richard.

3 REPLIES 3
anilelmastasi
Super User
Super User

Hello @Dicken ,

 

Can you try List.Random function? 

https://community.fabric.microsoft.com/t5/Power-BI-Community-Blog/List-RandomBetween-function-in-Pow...

 

You can check this.

 

If this solved your issue, please mark it as the accepted solution.

ibarrau
Super User
Super User

Hi. Do you mean a list of random that even after a refresh will keep same values?

You could build it like the following code, specifying a seed to make it deterministic. Add a New blank query and create the function, you can call it getRandom:

(min as number, max as number, count as number, seed as number) =>
let
    range = max - min + 1,

    rnd =
        List.Transform(
            List.Random(count, seed),
            each Number.IntegerDivide(_ * range, 1) + min
        )
in
    rnd

Then you can call it any where, for example using your nros as example:

getRandom(97,122,100,1)

That would generate 100 estable numbers between 97 and 122.

I hope that helps,


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

Happy to help!

LaDataWeb Blog

Not sure i get this ;

let
    range = max - min + 1,

    rnd =
        List.Transform(
            List.Random(count, seed),
            each Number.IntegerDivide(_ * range, 1) + min
        )
in
    rnd

it does not seem very different to what I posted, and haveing tried, i still have a range starting at 0 ,
can you show an actual example,  where a  random list stable List is produced between a min andn max valess  say   10 an 20 ?   I have tried the abvoe 

let 
range = (122 - 97)+1
in
    List.Transform( 
         List.Random( 20, 1) , (x)=> Number.IntegerDivide( x * range , 1)
    )

and it just takes gvies range  of 1  - 26  ? 

Richard. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.