Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello, I was comparing total sales of this year vs last year. But look at the picture, In 2011, the last year sales is not matching with 2010. This is my dax formula
sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR(DimDate[Date]))
What's the problem actually?
Solved! Go to Solution.
Yeah, I have deleted it. I found the problem. I mistakenly chose Fiscal Year instead of Calender year (I could not notice it). Now everything is all right with the sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR(DimDate[Date])) formula.
Your last code didn't work actually. But I am grateful to you because you tried to help me a lot. Thank you so much.
Yeah, I have deleted it. I found the problem. I mistakenly chose Fiscal Year instead of Calender year (I could not notice it). Now everything is all right with the sales LY = CALCULATE( [Total Sales], SAMEPERIODLASTYEAR(DimDate[Date])) formula.
Your last code didn't work actually. But I am grateful to you because you tried to help me a lot. Thank you so much.
I disagree with your assessment. I'm not going to write it for you but I'm trying to give you encouragement.
See my previous post for hint.
I was trying to give the algorithm rather than explicit directions for the measure.
Filter arguments are of the form : column = some value (which uses an aggregation).
You have part of the solution but not all of it.
I suspect this is to do with getting a date period shifted back 1 year but what you really want is to subtract one from the Fiscal year filter. There will be differences of a few days which shows as a difference in the table .
So rewrite the measure without sameperiodlastyear but subtracting 1 from the fiscal year
User | Count |
---|---|
25 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
25 | |
12 | |
11 | |
10 | |
6 |