Forum Discussion
Count Occurrence in a Column- must be dynamic
- 3 years ago
Hi aflintdepm
I was able to simulate the output without using any DAX.
In matrix visual, do these steps:
Rows -> Date
Columns -> Reason
Values -> Count of Reason (not distinct)
-> Count of Reason (Show value as percentage of total)
Rename the value headers accordingly.
Output:
Let me know if I am missing something.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Create a Calendar Table with a relationship (Many to One and SIngle) from the Date column of the Data Table to the Date column of the Calendar Table. To the matrix visual, drag Date from the Calendar Table to row labels and Reason to Column labels. Write this measure and drag it to the visual
Count = countrows(Data)
Count (%) by date = calculate([Count],all(calendar))
Count (%) by Reason = calculate([Count],all(Data[Reason]))
Format the last 2 measures as %.
Hope this helps.
This got me closer, but is not working properly
- I had a calendar table identified already, so that part worked. However, when I add it to the matrix, it retruns dates that are not in the fact table. My data is only from 12/29/22, but the matrix is returning values from 6/1/20
- Only the Count % by Date is returning results. The % Count by Reason is blank in all columns
- The Count % by Date is returning multiple results >100%, so something is wrong there
I know it is difficult to assist without sample data to manipulate, so I truly appreciate your help.
- Ashish_Mathur3 years ago
Super User
I will need to see your file.