Forum Discussion
Average - Distinct Count
- 2 years ago
Hi
I resolved this by
- Creating a column in the INS_Main Claim Data table and called it [AverageCountColumn] which placed a number 1 in each row of the table
- Within the same table I created a field called Month_Year which was the Notification Date in the format of
Notification Month Year = FORMAT([NotificationDate]," mmm yyyy")
- I created a measure which calculated a distinctcount of the notification month year:-
Z_Count of Month_Year = (DISTINCTCOUNT('INS_Main Claim Data'[Notification Month Year]))
- I created a measure of the count of the total claim refs:-
z_Generic_No of Claims Distinct = DISTINCTCOUNT('INS_Main Claim Data'[ClaimRef])
- I created an average measure
z_1Average = DIVIDE([z_Generic_No of Claims Distinct],[Z_Count of Month_Year])
- I then created the matrix
- I created the matrix and hid all the average fields apart from the average total
Using a slicer I can now create the a table below which calculates the average based on the number of distinct month year values. I am sure there is a cleverer way to do this using DAX but with my limited knowledge this solution has worked.
Below I have a column called z_Average with the following. At the moment it is dividing distinct count of the Claim Ref, by the distinct count of the month year. How do it amend it so it divides by the count of the month_year which in the example should be 3 (April 2024, June 2024 and May 2024) as opposed to 1 month.
z_Average = DIVIDE(DISTINCTCOUNT('INS_Main Claim Data'[ClaimRef], DISTINCTCOUNT('INS_Fin_Calendar Main Claim Data Notification Date'[month_year]))
- lbendlin2 years agoSuper User
You will have to define what to do with months that you have selected but that have no data. Should they be considered for the average or not?