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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Amardeep100115
Post Prodigy
Post Prodigy

How to count City where Persno count is <25

HI How can i get count of city where i can get output for Count of Persno is <25? sample data is available on below link https://1drv.ms/u/s!Ai3rGPgy20kLwRlVi7ohP0yYHHek?e=73Uw8I Thanks
Amardeep Bhingardeve
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Amardeep100115 

You could create measures

PRN count = CALCULATE(DISTINCTCOUNT(data[Persno]),ALLEXCEPT(data,data[City Pin Coad]))

<25_1 = CALCULATE(DISTINCTCOUNT(data[City Pin Coad]),FILTER(data,[PRN count]<25))

5.png

Or create columns

flag = CALCULATE(DISTINCTCOUNT(data[Persno]),FILTER(ALL(data),data[City Pin Coad]=EARLIER(data[City Pin Coad])))

<25_column = CALCULATE(DISTINCTCOUNT(data[City Pin Coad]),FILTER(ALL(data),data[flag]<25))

Best Regards
Maggie

 

Community Support Team _ Maggie Li
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
v-juanli-msft
Community Support
Community Support

Hi @Amardeep100115 

You could create measures

PRN count = CALCULATE(DISTINCTCOUNT(data[Persno]),ALLEXCEPT(data,data[City Pin Coad]))

<25_1 = CALCULATE(DISTINCTCOUNT(data[City Pin Coad]),FILTER(data,[PRN count]<25))

5.png

Or create columns

flag = CALCULATE(DISTINCTCOUNT(data[Persno]),FILTER(ALL(data),data[City Pin Coad]=EARLIER(data[City Pin Coad])))

<25_column = CALCULATE(DISTINCTCOUNT(data[City Pin Coad]),FILTER(ALL(data),data[flag]<25))

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

JIGAR
Resolver IV
Resolver IV

@Amardeep100115 

 

Based on your pbix file sample data, use this DAX formula for your <25 Measure

 

<25 = CALCULATE(DISTINCTCOUNT(data[City Pin Coad]),FILTER(data,[PRN count] < 25))
 
This will give you count of distinct cities where person count is < 25
 
Hope this helps !!
 
Please mark it accepted if the solution was appropriate.
 
Thanks

Could you please share working Power BI file
Please
Amardeep Bhingardeve

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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