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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
LeeI
Frequent Visitor

question about using PreviousDay function

I have a simple measure that is supposed to return the previous days number for a count of apps that meet a certain criteria. At first, I tried this dax expression: 

 

Apps previous day = Calculate(

                                                  count(data[app Number]), Previousday(date DIM [Date]))

 

This expression does not return an error, but it also does not return any values. I was able to get the measure to work properly by using:

 

Apps Previous Day =
CALCULATE(
    COUNT(Data[app Number]),
    FILTER(
        ALL('Date DIM'),
        'Date DIM'[Date] = Today() -1
    )
       
)
 
However, I am confused why the first dax expression does not work. Especially since Microsoft's publishing of the previousday function seems to imply that it should. 
 
 
Would anyone be able to help me understand why the first dax expression does not seem to be working properly? 
 
Thanks, 

 

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@LeeI  , The PREVIOUSDAY function is a time intelligence function that works with a date column to return a table containing the previous day. However, it requires a proper date context to function correctly.

 

Try using ALL function to remove any existing filter on dim[date]

 

Apps previous day =
CALCULATE(
COUNT(data[app Number]),
PREVIOUSDAY(ALL('Date DIM'[Date]))
)

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

1 REPLY 1
bhanu_gautam
Super User
Super User

@LeeI  , The PREVIOUSDAY function is a time intelligence function that works with a date column to return a table containing the previous day. However, it requires a proper date context to function correctly.

 

Try using ALL function to remove any existing filter on dim[date]

 

Apps previous day =
CALCULATE(
COUNT(data[app Number]),
PREVIOUSDAY(ALL('Date DIM'[Date]))
)

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.