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

need help on formula field

(0) ShareShare
ReportReport
Posted on by 10

Hi,

I am converting formula field from Salesforce .Below is the formula,

IF(DATEVALUE(CreatedDate) = DATEVALUE(Completed_Date_Time__c),
(Completed_Date_Time__c - CreatedDate) * 24,
((CASE(MOD(DATEVALUE(CreatedDate) - DATE(1985,6,24),7),
0 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+ (FLOOR((DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate))/7)*5)
- 2) * 9)
+
MAX((
DATETIMEVALUE(TEXT(YEAR(DATEVALUE(CreatedDate))) & "-" & TEXT(MONTH(DATEVALUE(CreatedDate))) & "-" & TEXT(DAY(DATEVALUE(CreatedDate))) & " 01:00:00am") - CreatedDate + 1) * 24, 0))
+
MAX((Completed_Date_Time__c -
DATETIMEVALUE(TEXT(YEAR(DATEVALUE(Completed_Date_Time_c))) & "-" & TEXT(MONTH(DATEVALUE(Completed_Date_Timec))) & "-" & TEXT(DAY(DATEVALUE(Completed_Date_Time_c))) & " 16:00:00pm")) * 24, 0)

How to convert in Dynamics Crm.??

Using Formula column from Powerapps  there is 1000 characetrs limit??

Thanks

I have the same question (0)
  • Guido Preite Profile Picture
    54,086 Moderator on at

    what this formula does exactly?

  • EKL Profile Picture
    10 on at

    Thank you Guido ,We don't have much info  as of now but it is calculation based on created date and completed date fields and some other logic which is not understandable.

    So I tried to replace Switch in place of CASE ,Date in place of DATEVALUE etc but limitation of 1000 characters is coming in Formula column of powerapps.

    pastedimage1677927582397v4.png

  • Guido Preite Profile Picture
    54,086 Moderator on at

    without knowing what the  formula is doing exactly you will not be sure also if you convert the code. Try to understand what the formula does exactly (there are salesforce communities like salesforce.stackexchange.com/ ) and after you have the logic converting to dynamics will be easier for you

    hope it helps

  • Leco Lv Profile Picture
    on at

    Hi partner,

    The dynamics 365 formula column is using power fx. As Guido suggested, after you know exactly what the formula does, you can come back to this case to list your needs or open a new case.

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 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans