Forum Discussion
How to create aggregate counts multiple times on the same field in a table
- 3 years ago
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:
To do this, and if your 2 column table was in a query called "Extract":
- Create a measure with this DAX expression: CategoryCount = COUNT('Extract'[Value])
- Create a "Matrix" visual
- Within the visual,
- Put "Category" into Rows
- Value into Columns
- CategoryCount into Values
4. Under "Format your visual", turn off "Column subtotals" and "Row subtotals"
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
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:
To do this, and if your 2 column table was in a query called "Extract":
- Create a measure with this DAX expression: CategoryCount = COUNT('Extract'[Value])
- Create a "Matrix" visual
- Within the visual,
- Put "Category" into Rows
- Value into Columns
- CategoryCount into Values
4. Under "Format your visual", turn off "Column subtotals" and "Row subtotals"
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