Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I would like to dynamically calculate the average percentage of the last 3 months .
in the matrix (screenshot) you can see the percentage per month which is a calculated measure. Is it possible to dynamically calculate the average of the last 3 months where the outcome is ((79,06+76,88+75,85)/3=) 77,26?
Solved! Go to Solution.
Hi @EVIJ,
I did some change on the formula provided by @johnt75 , i think that some context is not right and please try this:
Avg last 3 months =
VAR maxDate =
MAX ( 'Date'[Date] )
VAR summaryTable =
SUMMARIZE (
FILTER (
ALLSELECTED ( 'Date' ),
[Date] > EOMONTH ( maxDate, -4 )
&& 'Date'[Date] <= EOMONTH ( maxDate, -1 )
),
[Year_Month],
"Existing measure", [Existing measure]
)
RETURN
AVERAGEX ( summaryTable, [Existing measure] )
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @EVIJ,
I did some change on the formula provided by @johnt75 , i think that some context is not right and please try this:
Avg last 3 months =
VAR maxDate =
MAX ( 'Date'[Date] )
VAR summaryTable =
SUMMARIZE (
FILTER (
ALLSELECTED ( 'Date' ),
[Date] > EOMONTH ( maxDate, -4 )
&& 'Date'[Date] <= EOMONTH ( maxDate, -1 )
),
[Year_Month],
"Existing measure", [Existing measure]
)
RETURN
AVERAGEX ( summaryTable, [Existing measure] )
Pbix in the end you can refer.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can do something like
Avg last 3 months =
var maxDate = MAX('Date'[Date])
var summaryTable = ADDCOLUMNS( CALCULATETABLE(
SUMMARIZE( 'Date', 'Date'[Year month]),
'Date'[Date] <= maxDate && 'Date'[Date] > EOMONTH(maxDate, -4)
), "@val", [Existing measure])
return AVERAGEX( summaryTable, [@val])
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |