cancel
Showing results 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.

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.

 Location Sales Y/N London 1 Berlin 0

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
Community Support

Hi @misiek5510 ,

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

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

Final output:

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.

2 REPLIES 2
Community Support

Hi @misiek5510 ,

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

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

Final output:

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.

Helper III

Thank you very much. Worked immidetaly.

Announcements

#### 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

#### Power BI Monthly Update - April 2024

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

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors