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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ajayemmadi1
Helper I
Helper I

Previous Day Value

I am facing and issue in fetching previous day amount using current day amount. Can anyone let me know the exact DAX formula for the same.

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@ajayemmadi1 ,

Do you have a calendar table? You can use the DAX below. If you still have questions, please share sample data of your table and post expected result here.

Previous day amount= CALCULATE(SUM(Yourtable[Amount]), PREVIOUSDAY('DateTime'[DateKey])) 



Reference:
https://docs.microsoft.com/en-us/dax/previousday-function-dax

 

 

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi I just want to display last day sale of month. 

If last day sale is Zero then it should take previous day sale.

If that also zero then again it should take previous day sale.

Like that it should be dynamic.

Can you pleae write a DAX and send to me.

v-yuezhe-msft
Employee
Employee

@ajayemmadi1 ,

Do you have a calendar table? You can use the DAX below. If you still have questions, please share sample data of your table and post expected result here.

Previous day amount= CALCULATE(SUM(Yourtable[Amount]), PREVIOUSDAY('DateTime'[DateKey])) 



Reference:
https://docs.microsoft.com/en-us/dax/previousday-function-dax

 

 

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

What if the date of previous day didn't exist, for the example: 

Date                    Value
23 Jan 2021          10
24 Jan 2021          100
26 Jan 2021          200

can that DAX formula still works?

In this case, the earlier() function is your friend.

Regards.

Atma.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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