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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors