Forum Discussion
Ho
- 6 years ago
Hi Anonymous ,
Firstly, suggest you to create a new date table, like below.
Date = CALENDARAUTO()Reference:
Creating Calendar Table in Power BI using DAX Functions
- Yesterday
Yesterday = CALCULATE([Total Sales],PREVIOUSDAY('Date'[Date]))- Last Week
Last Week = CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( ALL ( 'Date' ), WEEKNUM ( 'Date'[Date], 2 ) = WEEKNUM ( TODAY (), 2 ) - 1 ) )These are just samples. We can implement with different ways. You could reference the blogs to have a try.
Creating a dax calculated column for today,yesterday and next working day with variables
Calculate Previous Weeks Sales - Advanced DAX in Power BI
Week to Date Calculation in Power BI with DAX
Calculating MTD, QTD, YTD, Running and Cumulative Total in Power BI
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Power BI does all of this. You need a Date table (see this for creating one that is dynamic), and a good understanding of Time Intelligence functions. You can start here to see if it enough. But there are some really good books on DAX that have chapters on Time Intelligence.