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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
sanc_152
Helper I
Helper I

Create A button based on the measure result

Hi All,

 

I have a meausre which is returning the result in string format .basically the resulted output of the mesure is Win or Loss and it's a dynamic result .
So I want create a button at the top in PBI report SO If I click on the "Winner" Button measure only evaluates the Winner in the matrix Chart.

 

@amitchandak Please can you help on this .

1 ACCEPTED SOLUTION

thanks @v-yueyunzh-msft  for sharing you valuable feedbacks.
for few the cases the solution is working fine but few of them it is not working.

if we are using matrix chart with number month is there in the column feild then it is not working.

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share some data in a format the can be pasted in an MS Excel file.  Also, clearly define the criteria of win/loss.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yueyunzh-msft
Community Support
Community Support

Hi , @sanc_152 

According to your description, you want to "Create A button based on the measure result".

Here are the steps you can refer to :
(1)This is my test data:

vyueyunzhmsft_0-1681264572379.png

I create a measure to similuate your measure to return text :

Measure = IF( SUM('Table'[Value])>3 , "Winner" , "Loser")

 

(2)Due to the measure can not put it into the slicer visual , we need to click "New Table" to create a table which has one column as a slicer's field.And we do not need to create any relationship between two tables.

Table 2 = {"Winner","Loser"}

 

(3)We can create another measure as a filter :

Measure 2 = var _slicer = VALUES('Table 2'[Value])
return
IF([Measure] in _slicer ,1,-1)

 

Then we can put this measure on the "Filter on this visual" and configure it and then we can meet your need:

vyueyunzhmsft_1-1681264888551.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

thanks @v-yueyunzh-msft  for sharing you valuable feedbacks.
for few the cases the solution is working fine but few of them it is not working.

if we are using matrix chart with number month is there in the column feild then it is not working.

Hi , @sanc_152 

Sorry for that i may can not understand the situation like yous. Can you explain the "if we are using matrix chart with number month is there in the column feild then it is not working"?

The only way to use measure results as slicers is to create a dimension table and write the measure again to filter the values displayed. There is no way I can replicate your situation, nor do I have your test environment.

Can you  provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thanks For your efforts. I think in matrix chart we cannot perform that.
Still you can try 

sanc_152_0-1681299727034.png

viewpoint in matrix should be the above one .winner is measure which dynamically generating result in string format based on the S and D feilds comparision.

Query

need one slicer to filter out the values (S & D should be the vlaues avaialble in slicer).
when user select S from the slicer the result should be evalusted for S as winner

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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