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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi I have an issue,
I try to calculate cumulative weightet average for every month (days and Total already are measures)
I have data:
And I what to have for every month:
Jan = (total * days) / days
Feb = (Jan(total*days) + Feb(total*days)) / (Jan(days) + Feb(days))
March = (Jan(total*days) + Feb(total*days) + Mar(total*days)) / (Jan(days) + Feb(days)+Mar(days))
and so on...
how it is possible in Dax?
of course I have data not in one table, but Total and Days - are already measures.
Thanks for help!
Solved! Go to Solution.
Hi @Elwira_A ,
Maybe you can try this code to do that:
Measure =
VAR _s =
SUMMARIZE (
FILTER ( ALLSELECTED ( 'date' ), [Date] <= MAX ( 'Table'[Date] ) ),
[Date].[Month],
"sum*days", SUM ( 'Table'[Values] ) * [Days],
"days", [Days]
)
RETURN
DIVIDE ( SUMX ( _s, [sum*days] ), SUMX ( _s, [days] ) )
Result:
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 @Elwira_A ,
Maybe you can try this code to do that:
Measure =
VAR _s =
SUMMARIZE (
FILTER ( ALLSELECTED ( 'date' ), [Date] <= MAX ( 'Table'[Date] ) ),
[Date].[Month],
"sum*days", SUM ( 'Table'[Values] ) * [Days],
"days", [Days]
)
RETURN
DIVIDE ( SUMX ( _s, [sum*days] ), SUMX ( _s, [days] ) )
Result:
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.
It is great! I was looking for it! Thank you!! 🙂
@Elwira_A , Try a measure like below. I am using date table
Cumm = CALCULATE(averageX(values('Date'[Date]),calculate(SUM(Sales[Sales Amount]))) ,filter(allselected('Date'),'Date'[date] <=max('Date'[date])))
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
Hi,
I also use a date table.
But it isnt a solution, only for Total it is working, but when I multiply Total * Days = I have wrong data.
so the question is how to do it to get good results.
Thanks!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.