Forum Discussion
Anonymous
7 years agoNot applicable
PowerBi Average
Hi all, I’m new to PowerBI. Trying to display the average of previous day’s data (excluding today’s data) E.g. average 1st – 9th June. I’ve created the following formula so far, but it sums up till ...
Anonymous
7 years agoNot applicable
Anonymous Instead of using TOTALMTD(), another way you might want to try is to manually set a start and end dates. So the measure looks like this:
calcQuantity =
var thisMonthStart = DATE(YEAR(TODAY()),MONTH(TODAY()),1)
var thisMonthEnd = TODAY() - 1
return CALCULATE(AVG('Values'[Quantity]),
ALL(dim_date),
dim_date[calendar_date] >= thisMonthStart &&
dim_date[calendar_date] <= thisMonthEnd
)