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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 168 Super User 2026 Season 1

#2
NeerajPawar Profile Picture

NeerajPawar 65

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans