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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Libbyb23
Resolver I
Resolver I

How to Calculate MTD Change using two different date values?

Hi, 

I am working on a sales forecasting report and I am struggling on how to create a measure that would calculate the sum of 'Sales Data' [sales_price] but only for sales that had an order date and invoice date in the current month (MTD). 

My table 'Sales Data' has the following fields I need to use:

[sales_price]

[order_date]

[invoice_date]

*also i need this to update with my date slicer that is using another measure 'FullDateKey'. There is a relationship for this measure between the date and the 'sales data'[invoice_date], not the order date.*


Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Libbyb23 

 

First of all, measure can't be put into the slicer.You can create a date table using the following formula, and then create a relationship between the date table and the invoice_date column.

FullDateKey = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

 

Based on your needs, I have created the following table.

vjialongymsft_0-1717394103258.png

 

You can calculate total sales using the following Dax:

Measure = SUMX(FILTER('Table','Table'[invoice_date]<>BLANK()&&'Table'[order_date]<>BLANK()),'Table'[sales_price])

 

Result:

vjialongymsft_1-1717394222222.png

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Libbyb23 

 

First of all, measure can't be put into the slicer.You can create a date table using the following formula, and then create a relationship between the date table and the invoice_date column.

FullDateKey = CALENDAR(DATE(2024,1,1),DATE(2024,12,31))

 

Based on your needs, I have created the following table.

vjialongymsft_0-1717394103258.png

 

You can calculate total sales using the following Dax:

Measure = SUMX(FILTER('Table','Table'[invoice_date]<>BLANK()&&'Table'[order_date]<>BLANK()),'Table'[sales_price])

 

Result:

vjialongymsft_1-1717394222222.png

 

 

Best Regards,

Jayleny

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.