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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HawkB
Resolver I
Resolver I

Combine column entries and count into single calculated column to enable labelling on Bubble Map

Hi all, 

 

I have a map with various locations on it - e.g.:

 

UKDave
FranceGill
SpainFrancis
UKMoira
FinlandHan

 

(it goes on for longer...)

 

And I'd like to label the bubble map with more than just the country name when I use it as a location, so thought that I could combine the country name and a count of the country name into a single calcuated column so the end result would be

 

UK 2

France 1

Spain 1

Finland 1

 

And I could then combine these into the single field that I could use as location so that the data labels would read "UK: 2" as opposed to just "UK".

 

I feel like I am missing an obvious trick here and being dim, but any guidance would be appreciated.  

1 ACCEPTED SOLUTION
HawkB
Resolver I
Resolver I

Sorry for the slow reply, I had issues logging in.

 

I wanted to data to be displayed on the map without requiring a tooltip (so I could capture the image and share it and not lose the info), so I needed a calculated column:

 

BubbleCount = 'Table'[Country]&" : "&CALCULATE(COUNT('Table'[Country]), ALLEXCEPT('Table', 'Table'[Country]))
 
Which works! It did however cause an issue with some countries randomly being put in the wrong place, but I can work around that. Seems odd to not have this kind of feature (more detailed labelling) as standard in PowerBI. 

View solution in original post

2 REPLIES 2
HawkB
Resolver I
Resolver I

Sorry for the slow reply, I had issues logging in.

 

I wanted to data to be displayed on the map without requiring a tooltip (so I could capture the image and share it and not lose the info), so I needed a calculated column:

 

BubbleCount = 'Table'[Country]&" : "&CALCULATE(COUNT('Table'[Country]), ALLEXCEPT('Table', 'Table'[Country]))
 
Which works! It did however cause an issue with some countries randomly being put in the wrong place, but I can work around that. Seems odd to not have this kind of feature (more detailed labelling) as standard in PowerBI. 
jgeddes
Super User
Super User

If you create the measure

Formatted Country Measure =
var _count =
CALCULATE(COUNT(countryTable[Country]), ALLEXCEPT(countryTable,countryTable[Country]))
Return
SELECTEDVALUE(countryTable[Country]) & ": " & _count
 
and place it into the tooltips field you will end up with the result
jgeddes_0-1662584447139.png

If you want just the formatted measure as the tooltip you can get that using a custom tooltip page.

Quickly the result would be

jgeddes_1-1662584535792.png

But once you get into custom tooltips there are plenty of options available to make the tooltip look/say what you want.




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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