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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
leneprd
Regular Visitor

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.Q1.jpg

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
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 namedon't select any nameselect one nameselect one name

 

Best Regards,

Lin

 

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

View solution in original post

6 REPLIES 6
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!

v-lili6-msft
Community Support
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 namedon't select any nameselect one nameselect one name

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

thanks for your solution🙂

it's a great help

 

It's work... Heart

 

TQSM v-lili6-msft

Anonymous
Not applicable

Create a measure that makes use of the HASONEVALUE or ISFILTERED functions.  The logic would be something like "If Names is filtered then FIRSTNONBLANK of Names else "Default".

 

https://docs.microsoft.com/en-us/dax/hasonevalue-function-dax

https://docs.microsoft.com/en-us/dax/isfiltered-function-dax

https://docs.microsoft.com/en-us/dax/firstnonblank-function-dax

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

 

TQ

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.