Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Community,
My goal is to build a report where a user uses a "random button". After clicking this button, it produces a Number between 1 and 100. My idea is to use the Randbetween function. The button should trigger the measure "Measure = RANDBETWEEN(1,100)" and the output ( for example a Card Visual) should be random everytime the user clicks the button.
Any ideas how to build a solution is much appreciated!
Solved! Go to Solution.
Hi @Anonymous ,
First create a table as below:
Table = GENERATESERIES(1,100,1)
Then create a measure as below:
Measure = RANDBETWEEN(1,100)
Import a custom visual from the market as below:
And you will see the magic:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
Hi @Anonymous ,
First create a table as below:
Table = GENERATESERIES(1,100,1)
Then create a measure as below:
Measure = RANDBETWEEN(1,100)
Import a custom visual from the market as below:
And you will see the magic:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my reply as a solution!
this is a good one. I tried the following:
- put the RANDBETWEEN measure on a card
- added another column to the visual filters
- created two bookmarks that use different values for this column
- created two buttons that switch between the bookmarks
Unfortunately RANDBETWEEN does only trigger once for each bookmark. So while you get different values for different filter choices, it's the same values over and over again.
Interesting documentation: RAND function (DAX) - DAX | Microsoft Docs
Of course you could do a report refresh with a PowerApps visual but that seems like overkill.
User | Count |
---|---|
75 | |
75 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |