cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
megferguson
Frequent Visitor

Filterable Count with Label

Hello,

 

I'm trying to create a shape map visual based on a 3 digit zip. The 3 digit zip is a created column based on the full zip code, so each 3 digit zip can repeat many times throughout the data. I've mocked up a sample dataset below with the key fields. There are more fields in the actual dataset that act as filters on the page as well.

 

ShippingPostalShippingPostal_SubstringId
123331233wer
123451231111
12346123111a
123471232345
12361123q234
12399123d43a
15533155342a
156441564rfd
15678156678s
19811134a321
19834198df34
19845198f4er
198561245432
198701981234
13423134u890



I need to group by each ShippingPostal_Substring and take a count of Id (or rowcount based on ShippingPostal_Substring). 

 

ShippingPostal_SubstringCountOfId
1236
1562
1985
1551
1341


Once I have the count I need to create a label based on the count value (<2, 2-5, >=5). 

 

ShippingPostal_SubstringCountOfIdLabel
1236>=5
15622-5
1985>=5
1551<2
1341<2

 

The problem that I'm running into is I need the label to be a column because it is acting as the legend in my map. I can get this all to work using measures, but that doesn't help me with the visual.

 

I have tried using the Group By functionality in the query editor, but this gives a static count value and I need the count to update based on the filters applied on the page. The label likewise must update as filters are applied. If the count value started at 6 with no filters applied and the filters dropped the count down to 3, I need the map to display the filtered count of 3 with a label of "2-5", not 6 with a label of ">=5". 

 

I have tried to create a calculated column for the count and put it into a table visual, let's call it [Count123]. If the field is left as "Don't Summarize", [Count123] shows as 1 for every PostalShipping_Substring; if the field is set to "Sum", the count displays correctly. Example of what I see from the table visual is below:

 

ShippingPostal_Substring

Count123

(Don't Summarize)

Count123

(Sum)

19815
Total 5

 

I have not been able to create a column that correctly counts the Id's that can then have a label correctly applied to it. The fact that the label has to be a column to work in the map visual is what is tripping me up.

 

Any suggestions of how to create a dynamic count with a column label that updates based on filters and slicers on the page would be very much appreciated. 

1 REPLY 1
PR20048119 Memorable Member
Memorable Member

Re: Filterable Count with Label

Column values are loaded at first load only they can't be changed based on applied filters.

For dynamic calculations you need to use measures only.


Thanks
Pravin


If it resolves your problem mark it as a solution and give Kudos.

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors