Forum Discussion
DATESMTD and DATESYTD Showing Same Values
Hi all,
I'm having some trouble with the DATESMTD and DATESYTD DAX functions.
I have a measure for Cost of Goods Sold as follows:
The MTD measure I have is as follows:
The fact table is correctly join to Dim_FiscalPeriod and Dim_FiscalPeriod is joined to CalendarTable (Dim_Date is connected to CalendarTable on Fiscal Period Start = Date).
The values change depending on which month is selected, so it is doing part of it correctly it seems.
Lastly, I get the same values if I use the CalendarTable.Date field in the two DAX functions.
Thanks in advance for any help.
I believe I have figured it out. Since I have a filter currently selected for month, the DAX was not viewing data outside of the filter context.
Changing the DAX to the following looks better. Now I just need to verify the data.
Current MTD = CALCULATE([Cost of Goods Sold],ALL(Dim_FiscalPeriod),DATESMTD(Dim_FiscalPeriod[Fiscal Period Start]))
2 Replies
- mwrdmFrequent Visitor
I believe I have figured it out. Since I have a filter currently selected for month, the DAX was not viewing data outside of the filter context.
Changing the DAX to the following looks better. Now I just need to verify the data.
Current MTD = CALCULATE([Cost of Goods Sold],ALL(Dim_FiscalPeriod),DATESMTD(Dim_FiscalPeriod[Fiscal Period Start]))- AnonymousNot applicable
Hi mwrdm ,
Does that make sense? If so, kindly mark your answer as the solution to close the case please. Thanks in advance. If not, please provide more details with your desired output and your pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.