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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Tamilarasan_
Regular Visitor

Show selected city from map visual in card visual using DAX

Hi

 

I have a map visual in my report that displays different cities. What I want to do is:

 

When I click/select a city in the map visual,

 

A card visual should dynamically display the name of the selected city.

 

 

I assume I need to use a DAX measure for this, but I'm not sure how to get the selected value properly when one city is selected.

 

 My Questions:

 

What DAX formula can I use to display the selected city in a card?

 

How can I handle cases where no city is selected or multiple cities are selected?

 

Is there a better way to achieve this?

1 ACCEPTED SOLUTION
Royel
Continued Contributor
Continued Contributor

Hay @Tamilarasan_  thanks for asking question. 

 

You can easily achieve this by using this Dax 

Selected City = 
IF(
    ISFILTERED('YourTable'[City]),
    SELECTEDVALUE('YourTable'[City], "Multiple Cities Selected"),
    "No City Selected"
)

 

Output: As you can see when i select City Dhaka it shows in "Dhaka" in the card. 

Royel_0-1753912048231.png

 

Without any selection: 

Royel_2-1753912140227.png

 

 Sample FIile Download from here:  https://limewire.com/d/ccvit#HiEeYHNF35 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

View solution in original post

1 REPLY 1
Royel
Continued Contributor
Continued Contributor

Hay @Tamilarasan_  thanks for asking question. 

 

You can easily achieve this by using this Dax 

Selected City = 
IF(
    ISFILTERED('YourTable'[City]),
    SELECTEDVALUE('YourTable'[City], "Multiple Cities Selected"),
    "No City Selected"
)

 

Output: As you can see when i select City Dhaka it shows in "Dhaka" in the card. 

Royel_0-1753912048231.png

 

Without any selection: 

Royel_2-1753912140227.png

 

 Sample FIile Download from here:  https://limewire.com/d/ccvit#HiEeYHNF35 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.