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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How create a list in dax

Hi all,

I neew create a dax measure that give me a list with the last available date with data and the last date from last month, also the delta between both, then I will put this in a matrix as colunm, like the example in attached. 

 

 

 

Power BI question.JPG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , You need measure like these with date tbale and time intelligence

 

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

 

Diff= [MTD Sales] -[last month Sales]

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

@Anonymous , You need measure like these with date tbale and time intelligence

 

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

 

Diff= [MTD Sales] -[last month Sales]

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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
Anonymous
Not applicable

Thank you so much for that!!! You help me a lot, just a quick recap, how can I add these results in a table?

Thank you again!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.