Forum Discussion

GabrielSDinamic's avatar
GabrielSDinamic
New Member
2 years ago
Solved

Show button if I select a value in table

I have a table with multiple entries, and a button that if I select a value from the table, the link from the button changes to a specific URL, but I want the button to be hide if nothing is selected in the table. Any ideas?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi GabrielSDinamic 

     

    Please try the following steps:

    1. Create a metric that outputs a different URL depending on the value selected.

    ButtonLink = IF(ISBLANK(SELECTEDVALUE('Table'[value])), "", "https://www.google.com")

     

    2.Apply this measure to the text of this button.

     

     

    This is the result you want:

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

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

2 Replies

  • There's a few ways - the first is to format the button to either be the same colour as the background if nothing is selected, or maybe show an error message. 

    So in the end, you'd have something like:
    IF(HASONEVALUE(Table[Field from your Table]), 

        // your URL here i.e something has been selected  in the table,

        // BLANK()

    )

    You can then format your button based on if the URL is blank or not.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi GabrielSDinamic 

     

    Please try the following steps:

    1. Create a metric that outputs a different URL depending on the value selected.

    ButtonLink = IF(ISBLANK(SELECTEDVALUE('Table'[value])), "", "https://www.google.com")

     

    2.Apply this measure to the text of this button.

     

     

    This is the result you want:

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

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