Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not 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 today’s (10th June) instead of only till 9th June data? How can I avoid including today’s data (10th June)?

 

 

Avg =

 

if ( EOMONTH(max('Date'[Date]);0)=EOMONTH(today();0);

(   TOTALMTD(SUM(Values[Quantity]);DATEADD(DATEADD('Date'[Date];0;Month);-1;Day))/day(today()-1)   );

 

(   TOTALMTD(SUM(Values[Quantity]);DATEADD(DATEADD('Date'[Date];0;Month);0;Day))/ day(EOMONTH(max('Date'[Date]);0))   )   )

 

Any ideas?

1 REPLY 1
Anonymous
Not 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
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.