Forum Discussion
Random Number
- Anonymous1 year ago
Hi Anonymous
Thank you very much dharmendars007 for your prompt reply.
The generation of random numbers focuses on randomness, so you want the RANDBETWEEN function to be more stable, which may defeat the meaning of randomness.
However, you might consider pre-generating a table of random numbers and using it in your report so that the random numbers are within the range of the pre-generated table on every refresh. For example:
"RandomNumbers"
Create a measure.
RandomNumber = VAR Index = RANDBETWEEN(1, COUNTROWS('RandomNumbers')) RETURN CALCULATE( FIRSTNONBLANK('RandomNumbers'[RandomValue], 1), FILTER('RandomNumbers', 'RandomNumbers'[Index] = Index) )Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
Thank you very much dharmendars007 for your prompt reply.
The generation of random numbers focuses on randomness, so you want the RANDBETWEEN function to be more stable, which may defeat the meaning of randomness.
However, you might consider pre-generating a table of random numbers and using it in your report so that the random numbers are within the range of the pre-generated table on every refresh. For example:
"RandomNumbers"
Create a measure.
RandomNumber =
VAR Index = RANDBETWEEN(1, COUNTROWS('RandomNumbers'))
RETURN
CALCULATE(
FIRSTNONBLANK('RandomNumbers'[RandomValue], 1),
FILTER('RandomNumbers', 'RandomNumbers'[Index] = Index)
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.