Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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
Solved! Go to Solution.
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 =
ADDCOLUMNS(
SUMMARIZE(
tabC, tabC[Year], tabC[Month])
, "avg", CALCULATE(AVERAGE(tabC[Value]))
)
VAR _result = AVERAGEX(_tab, [avg])
RETURN _result
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])
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])
Excellent! thank you! that's worked and has helped me make some other decisions too,. Very helpful, much appreciated!
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 =
ADDCOLUMNS(
SUMMARIZE(
tabC, tabC[Year], tabC[Month])
, "avg", CALCULATE(AVERAGE(tabC[Value]))
)
VAR _result = AVERAGEX(_tab, [avg])
RETURN _result
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 😊
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
86 | |
82 | |
70 | |
49 |
User | Count |
---|---|
143 | |
123 | |
107 | |
61 | |
55 |