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

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

Reply
Anonymous
Not applicable

How to create aggregate counts multiple times on the same field in a table

Hey! I'm pretty new with Power BI and I'm struggling to create a specific table in a report. I have data that looks like this:

 

Hanto_2-1687334667219.png

 

 

And want to create a table that looks like this:

Hanto_3-1687334694576.png

 

Any help would be much appreciated. Thanks!

1 ACCEPTED SOLUTION
m13eam
Resolver III
Resolver III

Hi - if you were happy to make some compromises and were happy for it to look like the below, then it's fairly simple to do:

m13eam_0-1687355896821.png

To do this, and if your 2 column table was in a query called "Extract":

  1. Create a measure with this DAX expression: CategoryCount = COUNT('Extract'[Value])
  2. Create a "Matrix" visual
  3. Within the visual,
    1. Put "Category" into Rows
    2. Value into Columns
    3. CategoryCount into Values

m13eam_1-1687356194457.png

4. Under "Format your visual", turn off "Column subtotals" and "Row subtotals"

m13eam_2-1687356394872.png

 

If you need the column headers to be prefixed with "Count" and the blanks to show as 0 then it is possible, but requires extra work. I'm happy to help if that's the case, but hopefully the above is a good start!

 

Let me know how you get on, or if I've presumed knowledge with creating queries/tables/measures you haven't gained yet!

 

Thanks,

Matt

 

View solution in original post

1 REPLY 1
m13eam
Resolver III
Resolver III

Hi - if you were happy to make some compromises and were happy for it to look like the below, then it's fairly simple to do:

m13eam_0-1687355896821.png

To do this, and if your 2 column table was in a query called "Extract":

  1. Create a measure with this DAX expression: CategoryCount = COUNT('Extract'[Value])
  2. Create a "Matrix" visual
  3. Within the visual,
    1. Put "Category" into Rows
    2. Value into Columns
    3. CategoryCount into Values

m13eam_1-1687356194457.png

4. Under "Format your visual", turn off "Column subtotals" and "Row subtotals"

m13eam_2-1687356394872.png

 

If you need the column headers to be prefixed with "Count" and the blanks to show as 0 then it is possible, but requires extra work. I'm happy to help if that's the case, but hopefully the above is a good start!

 

Let me know how you get on, or if I've presumed knowledge with creating queries/tables/measures you haven't gained yet!

 

Thanks,

Matt

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.