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
CLANG10
Helper I
Helper I

DAX expression to calculate elapsed days from current date

Hi, How do i write a DAX expression to calculate the elasped days from current date in table below... Thanks in advance for the advise.

CLANG10_0-1666229017558.png

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @CLANG10 ,

 

In my tests, everything works fine whether the column is created as a measure or a calculated column, so you can check if there is a problem.

Days = 
var cur = 'Table'[Date]
return DATEDIFF(cur,TODAY(),DAY)
M_days = 
var cur = MAX('Table'[Date])
return DATEDIFF(cur,TODAY(),DAY)

vhenrykmstf_0-1666950771005.png

 

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

6 REPLIES 6
v-henryk-mstf
Community Support
Community Support

Hi @CLANG10 ,

 

In my tests, everything works fine whether the column is created as a measure or a calculated column, so you can check if there is a problem.

Days = 
var cur = 'Table'[Date]
return DATEDIFF(cur,TODAY(),DAY)
M_days = 
var cur = MAX('Table'[Date])
return DATEDIFF(cur,TODAY(),DAY)

vhenrykmstf_0-1666950771005.png

 

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


Best Regards,
Henry


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

Thennarasu_R
Responsive Resident
Responsive Resident

Try this in measure
   Measure = var A=min(Submission date)
                     var B=max (Current date)
         return
             Var B- Var A
Let me known I will Work or not.

Thanks...but still can't work...

amitchandak
Super User
Super User

@CLANG10 ,

 

You can create a new column

 

Diff= datediff([Submission Date], Today(), Day)

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 Amit, thank you for the response, could u further advise how to auto apply this to all the rows in the table...i got the syntax error below...

CLANG10_0-1666239864350.png

 

@CLANG10 ,

Did you created the calculated column? And, Can I ask the reason for using ALLSELECTED in the DAX expression?

Thanks,





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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