Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
How can I use RANBETWEEN formula, but make it more stable, as everytime i open the report , it varies too much.
Eg: I am using RANDBETWEEN(90,210) but the variation should be minimum each time i open the report/refresh.
Solved! Go to Solution.
Hi @Antmkjr
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 @Antmkjr
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.
Hello @Antmkjr ,
When you say resut should be minimum can you be more specific like coould you share a example like expected result..This will help us to check further.
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes are much appreciated!
Thank You
Dharmendar S
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |