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
sclement
Regular Visitor

MTD measure or column based on Date Slicer

Hi All,

 

I have  a table like below that is fetching from sql. 

'Screen Shot 2022-05-30 at 7.32.22 pm.png

I have a slicer in my report which takes the Calendar table date. I am after obtaing MTD for both products for the Date which are doesn't have any sales data for that date.

 

for eg: In the above table, I don't have sales data for 22/05/22, and when I select the date '22/05/22' in my slicer I would like to get  the below table.

 

 Screen Shot 2022-05-30 at 7.38.42 pm.png

 

Also, If I today is 30/05/2022, and there is no sales data since 23/05/2022, I want to  get the below table: 

Screen Shot 2022-05-30 at 7.40.55 pm.png

 

I was wondering if there is any methods to accomplish the above requirement. It would be great if anyone could help on this.

 

Thanks in advance, S

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sclement , have you already tried dates mtd with date table. Where date table is used in selection

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

 

Or formula based on today

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@sclement , have you already tried dates mtd with date table. Where date table is used in selection

 

MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

 

Or formula based on today

 

https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27...
last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak 

 

I think this solution worked well. Thank you very much for helping me on this.

 

Cheers!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors