Forum Discussion

leneprd's avatar
leneprd
Regular Visitor
7 years ago
Solved

How to set default value

Hi,

 

I want to know how to set default value.

i have a table of names.. and i'm using a smart filter as search engine. When user search names, a name will be display in "card". But, in defaut mode (not searching anything) the "card" should display "Default" word not a first name in the table. How i want to do it.

  • hi, leneprd

    You could create a measure like below:

    Measure = IF(ISFILTERED(Table1[Names]),FIRSTNONBLANK(Table1[Names],Table1[Names]),"default value")

    Then drag this measure into card instead of name field

     

    Result:

    don't select any nameselect one name

     

    Best Regards,

    Lin

     

6 Replies

  • v-lili6-msft's avatar
    v-lili6-msft
    Community Support

    hi, leneprd

    You could create a measure like below:

    Measure = IF(ISFILTERED(Table1[Names]),FIRSTNONBLANK(Table1[Names],Table1[Names]),"default value")

    Then drag this measure into card instead of name field

     

    Result:

    don't select any nameselect one name

     

    Best Regards,

    Lin

     

    • leneprd's avatar
      leneprd
      Regular Visitor

      It's work... :heart:

       

      TQSM v-lili6-msft

    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks for your solution🙂

      it's a great help

       

    • leneprd's avatar
      leneprd
      Regular Visitor

      Sorry Ross73312 don't understand. I'm the beginner. If you can explain a bit detail, I appreciate it.

       

      TQ

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Everyone,

    v-lili6-msft 

    I am attempting this solution, but I am having trouble understanding why is (Table1[Names]) represented 3 times in this measure? 

    Table1[Names]
    Measure = IF(ISFILTERED(Table1[Names]),FIRSTNONBLANK(Table1[Names],Table1[Names]),"default value")

    I have a table of names and I'm using the basic filter pane for searching Customers. When the user selects a Customer, a name will be displayed in the card. BUT, If no Customer is slected,  the card should display a differnt word, i.e. "Default," not the first name in the table.

    Please help, it's not working for me!  Thank you!