Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

RUN DAX FROM A BUTTON

Hi All,

 

Is there any way of running DAX from a button?

 

I.e. Use DAX to set one tables filter state to ALL when a button is selected.

 

I am aware that bookmarks can be used to reset all filters, but this does not give the option to reset a finite set of filters whilst maintaining the users selections on a different set of filters.

 

Any ideas?

 

Thanks in advance!

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Don't know if I understand the question correctly but I use this trick

    1- create a one column table which won't be linked to any other table in the model

    2-insert text values like "MeasureA" and "MeasureB" in the column values. I usually put the name of the following measures for clarity
    3-create two measures, one with the ALL and one without 
    4-create a third measure that says: if the selected value in the unlinked table is "MeasureA", then give me the first measure. If the selected value is MeasureB, give me the second measure.
    5-put a slicer with the column created in the slicer selection (the one where you can select measure A and measure B)
    6-put the third measure in the graph/table and use this slicer as a toggle to switch between measure 

    Again I'm not sure this is the behaviour you want but this allows you to switch between the function with ALL and the function without the ALL and keep everything else as if it was the same measure

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi all,

       

      Unfortunately these options do not solve the problem.

       

      I am trying to create a button that resets the value of 17 slicers whilst maintaining the slicer values selected on 6 slicers.

       

      I.e. 6 'base' slicers, 17 'extra' slicers - button to reset only the 'extra' slicers and leave the base slicers in the state selected by the user.

       

      Thanks.

      • Anonymous's avatar
        Anonymous
        Not applicable

        You can actually use a bookmark and unflag the "data" option (if I remember correctly) on the base slicers, which will then stop interacting with the bookmark, while the others will be reset every time you click on it

  • Anonymous I don;t think button can do it, but you should create  a  slicer table and based on the value selected, add condition in your measure to include ALL data or fitlered data.