Forum Discussion
Calculate average count per month
Good day,
I am trying to calculate the average total count of "Location Codes" per month.For instance, in the below chart the average count per month is 3.5
| Location Code | Creation Date |
| 1 | 7/22/2020 |
| 2 | 7/22/2020 |
| 3 | 8/22/2020 |
| 4 | 8/23/2020 |
| 5 | 8/24/2020 |
| 6 | 8/25/2020 |
| 7 | 9/1/2020 |
| 8 | 9/2/2020 |
| 9 | 9/3/2020 |
| 10 | 9/4/2020 |
| 11 | 10/1/2020 |
| 12 | 10/2/2020 |
| 13 | 10/3/2020 |
| 14 | 10/4/2020 |
dw700d try this
Avg = AVERAGEX ( VALUES ( Table[Month] ), CALCULATE ( COUNTROWS ( Table ) ) )Assuming you have a month column in your table, or I would recommend adding a date dimension in your model, and then use a month column from that dimension, you can simply add one as per my blog post.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
4 Replies
- parry2kSuper User
dw700d it should be a simple measure
Avg = AVERAGE ( Table[Location] )Put month and avg in a table visual to see the result.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- parry2kSuper User
dw700d try this
Avg = AVERAGEX ( VALUES ( Table[Month] ), CALCULATE ( COUNTROWS ( Table ) ) )Assuming you have a month column in your table, or I would recommend adding a date dimension in your model, and then use a month column from that dimension, you can simply add one as per my blog post.
Check my latest blog post Compare Budgeted Scenarios vs. Actuals I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡