cancel
Showing results for
Did you mean:
Helper I

Calculating An Average Of A Measure

I have a table named ITC_DAILY_STATS that records one row for each application received.  Our months are divided into one of five categories, named month_code (12WD, 12WE, 3WD, 8WD, 8WE).  I'm trying to calculate the average number of apps received each month, grouped by the month_code.  In other words, what is the average number of apps received in the 12WD months, in the 12WE months, etc.  I have a slicer so the user can select one of the month_codes.

I have this measure to count the number of apps received, which works fine

App Count = count('ITC_DAILY_STATS'[APP_NUM])

Following other posts on here I wrote this measure to calculate the average of the 'App Count' measure
APP COUNT AVG = AVERAGEX(VALUES('A2055 ITC_BIZ_DATES'[Month Code]),'Calculations'[APP COUNT])

However, when I display the APP COUNT AVG in a card visual it gives me the total of all the months in that month_code rather than the average.  In this example below, the total is 147,276 but what I want is the average of that (36,819).

1 ACCEPTED SOLUTION
Super User

@SteveG_91 , Can try it on month year name

APP COUNT AVG = AVERAGEX(VALUES('A2055 ITC_BIZ_DATES'[Month Year name]),calculate([APP COUNT]) )

or

APP COUNT AVG = AVERAGEX(summarize('A2055 ITC_BIZ_DATES','A2055 ITC_BIZ_DATES'[Month Year name],[Month Code]),calculate([APP COUNT]) )

Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines
2 REPLIES 2
Super User

@SteveG_91 , Can try it on month year name

APP COUNT AVG = AVERAGEX(VALUES('A2055 ITC_BIZ_DATES'[Month Year name]),calculate([APP COUNT]) )

or

APP COUNT AVG = AVERAGEX(summarize('A2055 ITC_BIZ_DATES','A2055 ITC_BIZ_DATES'[Month Year name],[Month Code]),calculate([APP COUNT]) )

Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines
Helper I

Thanks @amitchandak , your first measure worked, APP COUNT AVG = AVERAGEX(VALUES('A2055 ITC_BIZ_DATES'[Month Year name]),calculate([APP COUNT]) ).

I thought I had used month year name on my first try and it didn't work so I switched to month_code.  I guess I didn't.  Anyway, thanks for your help!

Announcements

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors