datesmtd
2 TopicsDATESMTD misbehaving if Sales in current month are zero
If Sales for Salesperson in current month = 0, the following DAX will then fetch the Sales Amount for the last month that it can see Sales (at least I think this is what is happening) Sales MTD = CALCULATE([Amount Measure], DATESMTD('NAV_Sales History MASTER'[Posting Date])) So in this example, Sales for Jan are £0 but it is returning Sales for December For such a simple piece of DAX I'm struggling firstly to understand why it would retrieve the incorrect figure, and then why it would start looking for something outwith the current month? Totals for Salespeople who have sales in the current month are displaying fine. Any ideas at all?1KViews0likes3CommentsSameperiodlastyear for Month is not working
Currently, I have data (January 2020 through February 2021) and when I write this formula: Distinct Headcount = CALCULATE(DISTINCTCOUNTNOBLANK(Table1[EE Number]),DATESMTD(Table1[Date])) I get the count I am expecting for February 2021 as this is my MTD for 2021. But when I try writing a formula to get my 2020 MTD value, expecting that it will give me the February 2020 count using either SamePeriodLastYear or DateADD, the result I am getting is from December 2020 and not February 2020. I am not using, nor do i want to, a slider for dates. I want to be able to get the distinct count from a year ago which would be February 2020's distinct count. I have also tried using a calendar table due to the contiguous issue and and I still get the same result-the December 2020 count. This formula should work and display March counts when I add March 2021 data and bring back March 2020 data.Solved2.8KViews0likes3Comments