Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Please help me in this. I am using this measure to calculate monthly average from beginning of the year.
For the current month Ex. Jun-2023 I want the measure to consider Sales values till today and get average. (exclude the Sales where Date > today)
AvgM Sales = CALCULATE(
AVERAGEX(
VALUES(MainTable[Date]),
CALCULATE(SUM(
MainTable[Sales]))),
DATESMTD(ENDOFMONTH(MainTable[Date])))
Solved! Go to Solution.
Hi,
I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.
Avg Sales: =
VAR _endofmonth =
ENDOFMONTH ( MainTable[Date] )
VAR _t =
FILTER (
MainTable,
ENDOFMONTH ( MainTable[Date] ) = _endofmonth
&& MainTable[Date] <= TODAY ()
)
RETURN
AVERAGEX ( _t, MainTable[Sales] )
Hi,
I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.
Avg Sales: =
VAR _endofmonth =
ENDOFMONTH ( MainTable[Date] )
VAR _t =
FILTER (
MainTable,
ENDOFMONTH ( MainTable[Date] ) = _endofmonth
&& MainTable[Date] <= TODAY ()
)
RETURN
AVERAGEX ( _t, MainTable[Sales] )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 59 | |
| 51 | |
| 46 |