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
Anonymous
Not applicable

Map showing incorrect count but table is correct

I have a map that should show the number of issues per location for the selected time frame.  I have the following measure:

P1P2 Count = CALCULATE(COUNTROWS('Incidents'),('Incidents'[Priority]="1 - Critical" || 'Incidents'[Priority]="2 - High")
which properly counts the number of issues per location.
 
I have another measure intending to show the text of the Short Location followed by the P1P2 Count for that location for the date range selected by the user :
P1P2s by Location = 'Incidents'[Short Location] & ": " & CALCULATE([P1P2 Count],ALLEXCEPT('Incidents','Incidents'[Short Location],'Incidents'[Created]))
 
The problem is my map is showing a count of 1 for each location (at least one of the locations has 5).  When I click Show as Table, I get the proper counts.
 
Can someone help me fix the P1P2s by Location formula?
screenshot.jpg
 
 
 
screenshot.jpg
 
 
13 REPLIES 13
Ashish_Mathur
Super User
Super User

Hi,

What result do you get with this

P1P2s by Location = 'Incidents'[Short Location] & ": " & [P1P2 Count]


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Ashish,

I got the same result as shown in the original screenshots (so, if there is no difference, the simple formula is best) but it still is not correct.

 

Please keep trying.

I will need to see your file then.  Share the download link and clearly show the problem there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur 

 

Sorry for the delay...was out of the office.  Dumb question:  How do I attach the pbix?  I don't know where I should save it so that it can be accessed.

Store it on Google Drive and then share the download link here.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur  Yeah, that's what I was afraid of.  We aren't allowed to upload files to Google drive (security policy).  Is there a way to send the file to you (via email or something)?

v-xiaotang
Community Support
Community Support

Hi @Anonymous 

it may have something to do with  CALCULATE([P1P2 Count],ALLEXCEPT('Incidents','Incidents'[Short Location],'Incidents'[Created])).

what's the content of [P1P2 Count]? and could you share sample of related sheets?

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

The first pink formula shows how I got the value of P1P2 Count.  The second formula seems to be counting the distinct Short Locations (thus, each location is counted once).  What I need it to do is show the count of P1P2s for each location like it does in the table.

 

So, since there were 5 separate incident tickets created for Bangalore, the map label should read "Bangalore, India: 5".

 

I'm not sure what sheets you are asking for.

Hi @Anonymous 

I mean, could you share your sample data or sample file? tks

besides,

P1P2s by Location = 'Incidents'[Short Location] & ": " & CALCULATE([P1P2 Count],ALLEXCEPT('Incidents','Incidents'[Short Location],'Incidents'[Created]))
 
The problem is my map is showing a count of 1 for each location (at least one of the locations has 5).  When I click Show as Table, I get the proper counts.

not sure how you put the measure into Category label, in my test, I can only put column into it.

Looking forward to receiving your reply.

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Xiaotang,

The category label is the "P1P2s by Location" field which is a column calculation.  So it serves a dual purpose:  To identify the locations themselves and what the label should read.

Ruthie09_0-1629728391731.png

 

I learned this from Mitchell Pearson's video titled "How to add Data Labels to Maps in Power BI! Tips and Tricks":

https://www.youtube.com/watch?v=4ZOanVP1PS0

 

Greg_Deckler
Super User
Super User

@Anonymous Your India location is showing 5 represented by the larger circle size.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Right but the label is showing Bangalore, India:  1

Did you ever figure this out? I am experiencing the same issue

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.