Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

DAX function to hide Gauge visual by default

We are using the guage visual and the table visual in the powerBI report. Visual guage will show the health status of the machine. We have to search for the machine name in the visual search box (smart filter pro by visual OKVIZ). When searching for the machine name in the search box (smart filter pro by OKVIZ visual) we can see the results related to that machine in the visual meter and the visual table.

When we delete the machine name (do not search for any machine name) from the search box the data in the visual table will be deleted, but in visual guage it is still displayed on all the details of the average machine.

We want to apply filter to visual guage to show the data only when there is a machine name in the search box, if we have not searched for any machine name that visual guage should be a blank value.

For the table visual object, we can apply data segmentation to display data only when we search for the name of a machine, but we cannot apply filter for visual control.

 

As it is not possiable to hide using card. Can you please proivde DAX to hide Gauge by default and display the data in gauge visual based on searched item. 

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      We would like to gauge instaed of card. Can you help us with steps to hide data in gauge visual using DAX.

      • parry2k's avatar
        parry2k
        Super User

        Anonymous whatever measure you are using on gauge change that measure as below

         

        Measure for gauge = 
        IF ( HASONEFILTER ( Table[Machine] ), SUM ( Table[Column] ) ) 

         

        basically we are telling if no machine is selected/filtered then return blank value otherwise return value.

         

        I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!