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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
misiek5510
Helper III
Helper III

Count or Sum of a measure based on on a column

Hi,

 

I could not find a solution online, however I'm sure there is an simple answer to this. 

 

I have a measure that checks if a given location had any sales.  Sales Y/N =if([!Sales API]>0,1,0), now if you put it to table it will show 1, but if you put it with location names it will, show 0 or 1 e.g.

 

LocationSales Y/N
London1
Berlin0

 

 

My location table has over 1000 locations, so I'd like to be able to create a measure that will count all 1 for all avaiable locations, so I can use it in a card visual.

 

I've tried  Sales Check = calculate([Sales Y/N]=1,filter('Shared'[Location]) but it does not work. Any suggestions ? 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @misiek5510 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_1-1678672977513.png

Please try:

Measure = SUMX(SUMMARIZE('Table','Table'[Location],"Count",[Sales Y/N]),[Count])

Final output:

vjianbolimsft_0-1678672960886.png

Best Regards,

Jianbo 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

2 REPLIES 2
v-jianboli-msft
Community Support
Community Support

Hi @misiek5510 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_1-1678672977513.png

Please try:

Measure = SUMX(SUMMARIZE('Table','Table'[Location],"Count",[Sales Y/N]),[Count])

Final output:

vjianbolimsft_0-1678672960886.png

Best Regards,

Jianbo Li

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

Thank you very much. Worked immidetaly. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors