Is there a way to calculate the total days in the month we are in?

juliannarenaud
juliannarenaud Domo Employee

I want to calculate the % through the month. So (total days in month-current date)/total days in the month.

 

Does anyone know the beastmode to do this?

Comments

  • Shevy
    Shevy Contributor
    If you just want to count all days, then this will work: (DAYOFMONTH(LAST_DAY(CURRENT_DATE()))-(DAYOFMONTH(LAST_DAY(CURRENT_DATE()))-DAYOFMONTH(CURRENT_DATE())))/DAYOFMONTH(LAST_DAY(CURRENT_DATE()))
    Dojo Community Member
    ** Please like responses by clicking on the thumbs up
    ** Please Accept / check the answer that solved your problem / answered your question.
  • kshah008
    kshah008 Contributor

    @juliannarenaud, did Shevy's reply help you out?

  • Last day of month:

    DATE_SUB(DATE_ADD(`ActualDate`, interval 1 month), interval (DAYOFMONTH(DATE_ADD(`ActualDate`, interval 1 month))) day)

    Days in month:

    DAYOFMONTH(DATE_SUB(DATE_ADD(`ActualDate`, interval 1 month), interval (DAYOFMONTH(DATE_ADD(`ActualDate`, interval 1 month))) day))