web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Getting error in PowerFx formula to cancluate difference in 2 dates

(0) ShareShare
ReportReport
Posted on by 10
I am trying to calculate difference between 2 date fields to calculate number of years, no of days and hours. For this I have created a field with data type formula and used below formula:
 
Concatenate(DateDiff('Today Date',Text(Birthday,DateTimeFormat.LongDateTime24), TimeUnit.Years),/ Y /, DateDiff('Today Date',Birthday,TimeUnit.Days), / D /, DateDiff('Today Date',Birthday, TimeUnit.Hours)/60, / H /)
 
 
 
But I am getting an error in formula as: /Use the Text function to convert numbers to text. Include a format in the second argument, which cannot include a thousands or decimal separator in formula columns./ even after using the text function as mentioned in the documentation.
 
Can anyone help me in correcting this formula?
 
I have the same question (0)
  • Verified answer
    Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
    That is an indication that you need to add the second parameter of the Text function.
    The second parameter is used to determine the format in which the number will be displayed.
     
    This is my PowerFx column that shows the difference between two date fields.
     
    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more.
    If you have further questions, please feel free to contact me .
     
    Best Regards,
    Dengliang Li
     
  • rohitK264 Profile Picture
    10 on at
    Hi Dengliang Li,
     
    Thanks for your answer. It solved the error.
     
    But the issue I am facing now is it is calculating number of days between those 2 dates like 24Years10142Days. What I want is I want to display how many days are past above 24 years like 24Years2Days or 24Years350Days likewise.
    Is is possible through this expression ?
  • Dengliang Li Profile Picture
    Microsoft Employee on at
    Hi,
     
     
    You can use the Mod function to get the number of days remaining after dividing the total number of days by 365.
    Mod function - Power Platform | Microsoft Learn

     
     
    Best Regards,
    Dengliang Li
     
  • rohitK264 Profile Picture
    10 on at
    Hi Dengliang Li,
     
    Thanks a bunch.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 185 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 110

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 69 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans