The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi guys,
I need to caclulate the average count of 3 months for every month in a matrix.
For example : For August month The numbers which should be displayed is the average of June+july+august. and for july it should be July+june+may and so on. Please provide a measure for this.
The columns Iam using :
'Master append'[Groups] - in Rows
'Master append'[Month] - in Columns
'Measures Table'[TotalLeadsForSales] - in values. where,
Thanks and Regards.
Rishab Jain.
Solved! Go to Solution.
Hello sir @parry2k , Thanks for the reply.
I have tried the given code but problem still remains.
The average is only displayed in totals column. I want to display the average of 3 month(includes present month) for every month. For example the august column should have the average of jun july aug and the july should have avg of july june and may.
@rishabjain237 I think you need this:
Test 3 =
VAR numofmonths = 3
VAR LastSelectedDate = MAX('Master append'[Date])
VAR Period =
DATESINPERIOD('Master append'[Date],LastSelectedDate,-numofmonths,MONTH)
VAR Result =
CALCULATE(
AVERAGEX(
VALUES('Master append'[Month]),
[TotalLeadsForSales]
),
Period
)
Return
Result
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Hello sir @parry2k , Thanks for the reply.
I have tried the given code but problem still remains.
The average is only displayed in totals column. I want to display the average of 3 month(includes present month) for every month. For example the august column should have the average of jun july aug and the july should have avg of july june and may.
I have tried to this formula :
@parry2k @amitchandak Please need your advice in this. amit sir I have seen your weekly comparison videos. it was very help full. Thanks!