The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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?
Solved! Go to Solution.
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.
Without any selection:
Sample FIile Download from here: https://limewire.com/d/ccvit#HiEeYHNF35
Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
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.
Without any selection:
Sample FIile Download from here: https://limewire.com/d/ccvit#HiEeYHNF35
Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
32 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
45 |