The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |