Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have the following:
Prev Month Sales = CALCULATE(SUM('Sales History'[Sales Amount]), YEAR('Date'[Date])=YEAR(TODAY()), MONTH('Date'[Date]) = MONTH(TODAY()) - 2)
Prev Month Sales LY = CALCULATE ([Prev Month Sales], SAMEPERIODLASTYEAR('Date'[Date] ))
Both is returning the values for this year September. Is the SAMEPERIODLASTYEAR expected to work in this type of cases or am I missing something?
Solved! Go to Solution.
Total Sales LY and YTD Sales LY returns the same value, regardless of other filters applied. Perplexed.
@sanimesa,
How do you create your visual and what fields do you use to create slicers/filters?
In my scenario, I drag date/year field of Date table and the above measures to a table visual, and create slicers using Year and MonthName fields of Date table, Total Sales LY and YTD Sales LY return different values.
Regards,
Lydia
It's not a function I've used so someone else should have better knowledge but could you not just use the same measure you have for your previous month sales except sticking a -1 in the year section of your measure to get the result you want?
@jthomson I did that for now, but in general the SAMEPERIODLASTYEAR is not behaving as expected. The YTD Last year is returning full last year sum. Data in table seems to be correct.
For all of 2016 sales, I am using:
Total Sales LY = CALCULATE(SUM('Sales History'[Sales Amount]), YEAR('Date'[Date])=YEAR(TODAY())-1)
For YTD/YTD LY sales:
YTD Sales = TOTALYTD(SUM('Sales History'[Sales Amount]), 'Date'[Date])
YTD Sales LY = CALCULATE ([YTD Sales], SAMEPERIODLASTYEAR('Date'[Date] ))
Total Sales LY and YTD Sales LY returns the same value, regardless of other filters applied. Perplexed.
Total Sales LY and YTD Sales LY returns the same value, regardless of other filters applied. Perplexed.
@sanimesa,
How do you create your visual and what fields do you use to create slicers/filters?
In my scenario, I drag date/year field of Date table and the above measures to a table visual, and create slicers using Year and MonthName fields of Date table, Total Sales LY and YTD Sales LY return different values.
Regards,
Lydia
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |