Would like to know how to implement the following computation field in my portal.
MTD = (cumulativeSales/DIFFINDAYS( Now()-startMonthDate))*TotalMonthdays.
The challenge is obtaining the startMonthDate from the CurrentDate and endMonthDate from the CurrentDate at any given point and time.
Hi, you need to populate that date field in the on create/update of a record is that your scenario?
have you looked at calculated fields? https://docs.microsoft.com/en-us/powerapps/developer/data-platform/calculated-rollup-attributes
if you need to calculate on the load of the page, you will need to apply custom JS and add your logic in there
Thanks @OliverRodrigues perhaps i didn't capture my requirement well in the above.
I just need to know how to compute/Get StartofMonth from a given date (lets say 23/04/2021) as well as EndofMonth from the same date.
// Where d = a date object d.setDate(1) // sets the date to the first day d.setDate(0) // sets the date to the last day of the previous month d.setMonth(d.getMonth()+1, 1) // sets the date to the first day of the dates current month + 1
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.