Forum Discussion

db042190's avatar
db042190
Impactful Individual
1 year ago
Solved

having trouble with previousday function

Hi pls see below a dax expression thta isnt working for me.   I'd like to avoid vars as i dont use them.   my first attempt at this expressio involved passig Today() to PREVIOUSDAY.  I got the sense that passig a datetime wasnt valid so i tried passig DATEVALUE(TODAY()) but apparently am not doing this right.

 

IF((DATEDIFF(Dates[Date],TODAY(),MONTH) = 1 && DAY(Today())>1)||(DAY(Today())=1 && DATEDIFF(Dates[Date],PREVIOUSDAY(DATEVALUE(TODAY())),MONTH)=1),"LM",
 

 

  • Replace PREVIOUSDAY ( DATEVALUE ( TODAY () ) ) with TODAY () - 1

     

    If this helped, please consider giving kudos and mark as a solution

    me in replies or I'll lose your thread

    consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI

1 Reply

  • Replace PREVIOUSDAY ( DATEVALUE ( TODAY () ) ) with TODAY () - 1

     

    If this helped, please consider giving kudos and mark as a solution

    me in replies or I'll lose your thread

    consider voting this Power BI idea

    Francesco Bergamaschi

    MBA, M.Eng, M.Econ, Professor of BI