0
votes

I have a documents table being displayed in my report, then I added a slicer to filter these data using a date range. This is working as expected, but now I need to create a donut chart that should display the summarization.

I've created a calculated table using the SUMMARIZE function like this:

grouped_docs = SUMMARIZE(documents;documents[user_id];"DocCount"; COUNTROWS('documents'))

However, the slicer is ignored.

I also tried to create a measure with the following code:

DocCount = CALCULATE(GROUPBY(documents; documents[user_id]; "GroupByUser"; COUNTROWS(CURRENTGROUP())); ALLSELECTED('documents'))

But it says that that the GROUPBY needs to have aggregation functions on CURRENTGROUP.

My documents table structure is like this:

document_id (auto increment field)
scanDate
title
user_id

How can I get the count of documents grouped by user_id?

1

1 Answers

0
votes

I don't think you need any DAX for this. Just add the field: document_id to the Values well for the Donut Chart visual, and set it's summarization to Count.

If you do want a Measure, it would be something like this:

# Documents = DISTINCTCOUNT ( documents[document_id] )

Try a Treemap visual instead of a Donut Chart - the results are much clearer if you have more than 2 user_id values.