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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Tevon713
Helper IV
Helper IV

Count number of sites in a region

Hi. I have simple table with sites and region. Struggling to count number of sites per region. So when user select region it count return number of sites. Will this able to flex if I add a site slicer as well.

 

Here's sample table with data.

 

Tevon713_0-1654720026805.png

1 ACCEPTED SOLUTION

Hi @Tevon713 ,

 

Please try these measrues.

 

Average of Select Region = 
AVERAGEX ( ALLSELECTED ( 'Test 1' ), [Sum Machine Count] )
Static Average ALL =
AVERAGEX ( ALL ( 'Test 1' ), [Sum Machine Count] )

vkkfmsft_0-1655176482420.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
tackytechtom
Super User
Super User

Hi @Tevon713 ,

 

I might misunderstand the query, but wouldn't it work with an ordinary Measure = COUNTROWS('table')

 

Anytime you select a region in a slicer, it will automatically just count the rows (= Sites) that exist for that region.

 

If in your table occurs the same site multiple times in a region, I'd recommend a DISTINCTCOUNT ('table'[site])

 

Let me know if this helps 🙂

 

/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Thanks @tackytechtom for your quick reply. Sorry I didn't specify more. You correct in the countrows. I want to flex it count the site, then use in other calculation ie average of select region and static average for all. Maybe it in select avg and static avereage measures... giving incorrect output. I thought for moment I it was in the count.

 

Here the sample pbix.

https://www.dropbox.com/s/egipxxknpww4eew/Count%20Site%20per%20region.pbix?dl=0

 

When no filter are selected static average is correct.

Tevon713_2-1654723503462.png

 

When selecting a region select... incorrect for static average, average of select is correct... when site selected both are incorrect.

 

Tevon713_1-1654723401433.png

Hi @Tevon713 ,

 

Please try these measrues.

 

Average of Select Region = 
AVERAGEX ( ALLSELECTED ( 'Test 1' ), [Sum Machine Count] )
Static Average ALL =
AVERAGEX ( ALL ( 'Test 1' ), [Sum Machine Count] )

vkkfmsft_0-1655176482420.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-kkf-msft. Your solution work.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors