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
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
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.