Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Trigger a Measure with a Button

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!

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

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:

vkellymsft_0-1628501941134.png

 

And you will see the magic:

vkellymsft_1-1628501966873.png

vkellymsft_3-1628502159900.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

 

View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

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:

vkellymsft_0-1628501941134.png

 

And you will see the magic:

vkellymsft_1-1628501966873.png

vkellymsft_3-1628502159900.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my reply as a solution!

 

lbendlin
Super User
Super User

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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.