Avneesh Aggarwal
Avneesh Aggarwal

Reputation: 11

How to calculate average of a column that has text?

I have two columns. Column A is month year. Column B is title of a document. I have to show a simple line chart showing how many documents were created by month-year and then show a total average across all month years. i have tried averagex and created variables but the average is showing me per month instead of all the months.

so for example:

jan 2018 - 30 (count of documents) feb 2018 - 50 (count of documents) march 2018 - 15 (count of documents)

when I try to plot the average, it's showing me again 30, 50, 15 INSTEAD of 31.6 which is the average of 30,50,15). Can someone please help?
I tried both average and creating a measure but both are showing me average per month instead of average of the whole data

Upvotes: 0

Views: 50

Answers (1)

Ryan
Ryan

Reputation: 2447

here is the sample data

year month document
jan2018 a
jan2018 b
feb2018 c
feb2018 d
feb2018 e
mar2018 f
mar2018 g
mar2018 h
mar2018 i
mar2018 j
avg =
DIVIDE (
    CALCULATE ( COUNT ( 'Table'[document] ), ALL ( 'Table' ) ),
    CALCULATE ( DISTINCTCOUNT ( 'Table'[year month] ), ALL ( 'Table' ) )
)

enter image description here

Upvotes: 1

Related Questions