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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Return a string from reference column

Hi,

 

My issue is that I have tickets that are coming from diffrent countrys and I use a card in Power BI to show which country they are coming from. When I just apply the country on the card it's showing "first of country", but that could be missleading. I want it to only show the country if a specific ticket is selected.

 

How could I with a measurement do that?

 

I've come so far, but the last false statement ('SNOW(sn_sm_finance_request)'[country]) doesn't work.

 

Ticket Market = IF('SNOW(sn_sm_finance_request)'[Total ticket]>1; "No Specific Selected Ticket"; 'SNOW(sn_sm_finance_request)'[country])

 

 

The thing is that it work if I'm just writing "country" insted of the reference table, then it appears "country" when a specific ticket is selected. But I don't want that I want it to show the specific country for the selected ticket.

Ticket Market = IF('SNOW(sn_sm_finance_request)'[Total ticket]>1; "No Specific Selected Ticket"; "country")

 

I hope you understand. Just ask if you don't.

 

Regards, 

Albin

 

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

You want the selectedvalue function. This does exactly what you want. It returns a value only if there is a single value, otherwise it returns blank (or an optional alternate)



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

3 REPLIES 3
Stachu
Community Champion
Community Champion

this should work as long as tickets cannot have more than 1 country

Ticket Market = IF('SNOW(sn_sm_finance_request)'[Total ticket]>1; "No Specific Selected Ticket"; VALUES('SNOW(sn_sm_finance_request)'[country]))

you could also use

Ticket Market = SELECTEDVALUE('SNOW(sn_sm_finance_request)'[country],"No Specific Selected Ticket")

but it will return Country as long as there is only single one coming from the tickets selection

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

MattAllington
Community Champion
Community Champion

You want the selectedvalue function. This does exactly what you want. It returns a value only if there is a single value, otherwise it returns blank (or an optional alternate)



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
Anonymous
Not applicable

Thank you! Now it works.

 

Regards,

Albin

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors