cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## PowerBi Averaging issue

Hi, I have a table with 2 months worth of data. The average of all the data is 85% however this is based on PowerBi calculating all of the data across both months.

Instead I need it to calculate the average between the 2 months.

Example:

January is 85% and February is 87% so the average should be 86%

I've tried to figure this out but can't do it. What's the easiest way to arrive at 86%.

I will also need this calculation to work as we progress through the year so that I have an average based on all months by the end of the year.

Hope someone can help...p.s I'm not good (at the moment) with coding! hoping for a fairly simple fix if possible!

Thanks

2 ACCEPTED SOLUTIONS
Resolver III

Hi @Gimmerzz,

Assuming you have the following table named tabC:
Year Month Value
2023 Feb 75
2023 Jan 79
2023 Jan 86
2023 Jan 90
2023 Feb 99

You can try the fllowing measure to caclulate the average based on your requirements:

``````averageByMonth =
VAR _tab =
SUMMARIZE(
tabC, tabC[Year], tabC[Month])
, "avg", CALCULATE(AVERAGE(tabC[Value]))
)
VAR _result = AVERAGEX(_tab, [avg])
RETURN _result``````

Super User

Hello @Gimmerzz,

Can you please try the following:

1. Calculate Monthly Average

``````Monthly Average = AVERAGE(YourTable[YourPercentageColumn])
``````

2. Calculate Average of Monthly Averages

``````Average of Monthly Averages = AVERAGEX(VALUES(YourTable[MonthColumn]), [Monthly Average])
``````

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
4 REPLIES 4
Super User

Hello @Gimmerzz,

Can you please try the following:

1. Calculate Monthly Average

``````Monthly Average = AVERAGE(YourTable[YourPercentageColumn])
``````

2. Calculate Average of Monthly Averages

``````Average of Monthly Averages = AVERAGEX(VALUES(YourTable[MonthColumn]), [Monthly Average])
``````

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning
Regular Visitor

Excellent! thank you! that's worked and has helped me make some other decisions too,. Very helpful, much appreciated!

Resolver III

Hi @Gimmerzz,

Assuming you have the following table named tabC:
Year Month Value
2023 Feb 75
2023 Jan 79
2023 Jan 86
2023 Jan 90
2023 Feb 99

You can try the fllowing measure to caclulate the average based on your requirements:

``````averageByMonth =
VAR _tab =
SUMMARIZE(
tabC, tabC[Year], tabC[Month])
, "avg", CALCULATE(AVERAGE(tabC[Value]))
)
VAR _result = AVERAGEX(_tab, [avg])
RETURN _result``````

Regular Visitor

Hi, thank you for taking time to look into and respond to me, I used another option as found it easier to understand/implement however I will review what you've shared again to see what I can learn from you. Thanks 😊

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors