Hi there, trying to solve what should seem like a fairly straightforward reporting/visual problem. I am trying to compare LY Total Sales to CY Total Sales using a line chart by month
The problem is that when I use am expression like this:
Example1:
YTD Sales = TOTALYTD('fact'[Total Sales],'DateDimension'[Date])
I get blank results.
Oddly if I use :
Example 2
YTD Sales = TOTALYTD('fact'[Total Sales], 'fact'[DateOfSale])
I get what appear to be good result for CY, but some rason now LY has a big gap in it.
My model is pretty standard with a one to many dimDate ->facttable design joined on date. Every example I have looked at seems to say my first example is correct, however it does not work at all. The second example, I typically don't do and would expect it to be a little odd anyway, but not sure why example one is not working. I have done this type of YTD expression before and I feel it might be something else besides the expression, maybe a relationship, data type, some other issue. Could be I am just really tired lol. But I should be able to name the Date field from the Date dimension and this would work. I have never had to call the date field from the fact table itself.
Anyway any feedback or advice would be great. Been banging my head against this one all day and not sure what I am doing wrong or what setting I might be missing. TY!
Results of Example 1 expression( YTD TOTAL is completely missing)
YTD Sales = TOTALYTD('fact'[Total Sales],'DateDimension'[Date])
YTD completely missing
Example 2
YTD Sales = TOTALYTD('fact'[Total Sales], 'fact'[DateOfSale])