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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Campolas
Regular Visitor

Using Previousday

Hi guys! 

 

Im using PREVIOUSDAY to return sales profit on my dashboard, but the date returning isn't the actual date. 

For example, yesterday the date returned was 07-31-2022, but the real date was 08-10-2022. 

Anybody know what im possibly doing wrong?

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Campolas , It takes the first day from the context on the calendar if not date is selected. so if page has date range of this month, then it gives the last date, last month

 

You can try

Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))

Yesterday = CALCULATE([Net], FILTER('Date','Date'[Date] = Today()-1 ) )

 


Last Day = CALCULATE(sum('Table'[Qty]), dateadd('Date'[Date],-1, day))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Anonymous
Not applicable

Hi @Campolas ,

PREVIOUSDAY function will return a table that contains a column of all dates representing the day that is previous to the first date in the dates column, in the current context. Could you please provide the related formula of measure which involved PREVIOUSDAY function? And what's your final expected result? You can show some sample(fake) data(exclude sensitive data) to explain your requirement, later we can provide you a suitable solution. Thank you.

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Campolas ,

PREVIOUSDAY function will return a table that contains a column of all dates representing the day that is previous to the first date in the dates column, in the current context. Could you please provide the related formula of measure which involved PREVIOUSDAY function? And what's your final expected result? You can show some sample(fake) data(exclude sensitive data) to explain your requirement, later we can provide you a suitable solution. Thank you.

Best Regards

amitchandak
Super User
Super User

@Campolas , It takes the first day from the context on the calendar if not date is selected. so if page has date range of this month, then it gives the last date, last month

 

You can try

Last Day = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])-1))

Yesterday = CALCULATE([Net], FILTER('Date','Date'[Date] = Today()-1 ) )

 


Last Day = CALCULATE(sum('Table'[Qty]), dateadd('Date'[Date],-1, day))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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