Forum Discussion

stenford23's avatar
stenford23
Helper I
4 years ago
Solved

[Bug] Number.Random is not random.

Hi PBPQ team,   I found a strange behavious which seems a bug to me.   Number.Random doesn't work in the correct way when used inside Table.Group or Table.TransformColumns.   - Expected behavio...
  • v-kkf-msft's avatar
    v-kkf-msft
    4 years ago

    Hi stenford23 ,

     

    How about this approach? Use List.Random(1) to get random number, then use the Table.ExpandListColumn function to expand the list.

     

    = Table.ExpandListColumn(Table.TransformColumns(grouped_table, {"random_number", each List.Random(1), type number}),"random_number")

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.