Forum Discussion
MTD and Last Year MTD - DAX - DirectQuery
- Anonymous7 years ago
I noticed there are some problems with grouping in PowerBI. Now it is working without any changes in my previous calculations.
Thank you for your time and help!
Hi,
Create a Calendar Table and build a relationship from the Date column of the Daily Table to the Date column of the Calendar Table. Create a slicer from the Date column of the Calendar table and select any date there. Write these measures
Sales MTD = CALCULATE(sum(Daily[Trx]),MTD(Calendar[Date]))
Sales MTD LY = CALCULATE([Sales MTD],SAMEPERIODLASTYEAR(Calendar[Date]))
- Anonymous7 years agoNot applicable
Hi Ashish,
Thank you for your response!
I need to align current year weekdays with those of last year, not sure how I can achieve this by using SAMEPERIODLASTYEAR formula.
Also, this works when I manually filter dates, however this table is getting updated on daily basis. Any recommendation on any alternative approach?
Much obliged!
- Ashish_Mathur7 years ago
Super User
Hi,
I can help you only if you share some data and the expected result.
- Anonymous7 years agoNot applicable
I noticed there are some problems with grouping in PowerBI. Now it is working without any changes in my previous calculations.
Thank you for your time and help!