Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to generate random seeded values

hi everyone

 

is there a way to seed the random value generated by DAX

 

tried the below link but every time i open the file the numbers still changes 

Solved: Re: How to generate random number based on seed va... - Microsoft Power BI Community

  • Hi, Anonymous ;

    Change it.

    Table = Addcolumns(GENERATESERIES(1,100,1), "New col", RAND())

    The final show:

    If not right , can you share your simple file and the result what you want to output?


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

  • Anonymous , Try if this code can help. I done something similar in past, that code is not handy

    Addcolumns(generate(1,100,1), "New col", var _1= rand() return _1)

    • Anonymous's avatar
      Anonymous
      Not applicable

      amitchandak generate(1,100,1) returning error for this part

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Anonymous ;

    Change it.

    Table = Addcolumns(GENERATESERIES(1,100,1), "New col", RAND())

    The final show:

    If not right , can you share your simple file and the result what you want to output?


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.