ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Finding the Last Day of the Previous Month

BrandonS4
8 - Asteroid

Hello all!  I am trying to find the correct formula to find the last day of the previous month.  I am running a report that will calculate DSO and I need to multiply by the number of days in the previous month.  Any help would be appreciated!

 

Thanks!

11 REPLIES 11
KLAMB
6 - Meteoroid

How could this be modified to pull first day of prior month (ie, 2021-07-01).

BrandonS4
8 - Asteroid

Previous Month = DateTimeAdd([OriginalDate],-1,"month")

FirstOfPreviousMonth = DateTimeAdd([Previous Month], 1-DateTimeDay([Previous Month]), "days")

LastOfPreviousMonth = DateTimeAdd([OriginalDate], 0-DateTimeDay([OriginalDate]), "days")

Labels
Top Solution Authors