March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi
I have created a table with Values on a column of text values which are the agent statuses when logging in and out.
Would like to create a count of how many times each status occurred.
Statuses = VALUES('Agent Status Summary'[Status])
This creates the table and returns as expect the unique strings.
But how do I get the count of each occurence of each value in the next column.
Currently it returns the count of all.
I have tried ifferent variants of formulas like
Count = CALCULATE(COUNTROWS('Agent Status Summary'),ALLEXCEPT('Agent Status Summary','Agent Status Summary'[Status]))
Count = COUNTX(VALUES('Agent Status Summary'), [Status])
Solved! Go to Solution.
Hi @HankScorpio2 ,
VALUES returns the distinct values of a referenced column in a calculated table but doesn't aggregate. Try this instead:
Summary =
ADDCOLUMNS (
SUMMARIZE ( Data, Category[Category] ),
"Count", CALCULATE ( COUNTROWS ( Data ) )
)
Proud to be a Super User!
@danextian Thanks for your contribution on this thread.
Hi @HankScorpio2 ,
You can follow the steps belwo to get it:
1. Create a measure as below:
Count =
VAR _status =
SELECTEDVALUE ( 'Agent Status Summary'[Status] )
RETURN
COUNTROWS (
FILTER ( 'Agent Status Summary', 'Agent Status Summary'[Status] = _status )
)
2. Create a table visual: drag the field 'Agent Status Summary'[Status] and the above new measure onto the visual
Best Regards
@danextian Thanks for your contribution on this thread.
Hi @HankScorpio2 ,
You can follow the steps belwo to get it:
1. Create a measure as below:
Count =
VAR _status =
SELECTEDVALUE ( 'Agent Status Summary'[Status] )
RETURN
COUNTROWS (
FILTER ( 'Agent Status Summary', 'Agent Status Summary'[Status] = _status )
)
2. Create a table visual: drag the field 'Agent Status Summary'[Status] and the above new measure onto the visual
Best Regards
Hi @HankScorpio2 ,
VALUES returns the distinct values of a referenced column in a calculated table but doesn't aggregate. Try this instead:
Summary =
ADDCOLUMNS (
SUMMARIZE ( Data, Category[Category] ),
"Count", CALCULATE ( COUNTROWS ( Data ) )
)
Proud to be a Super User!
Hi what does Data represent in your model, a measure?
SUMMARIZE is a table function so it can be applied to a physical or virtual table only.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
88 | |
74 | |
67 | |
49 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |