Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
db042190
Post Prodigy
Post Prodigy

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",
 
previousdaymystery.png

 

1 ACCEPTED SOLUTION
FBergamaschi
Solution Sage
Solution Sage

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

View solution in original post

1 REPLY 1
FBergamaschi
Solution Sage
Solution Sage

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

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors