Forum Discussion
ToffeeMark
6 years agoFrequent Visitor
Sales Growth SAMEPERIODLASTYEAR Help
Hi, I'm fairly new to Power BI, I've gone through the Microsoft Power BI training videos but lack experience so I hope someone could help with my question. I've made two measures that work to...
- 6 years ago
Hi ToffeeMark
Create measures
sales current = SUM(Sheet2[sales]) max date = CALCULATE(MAX(Sheet2[date]),ALLSELECTED(Sheet2)) end of the month = EOMONTH([max date],0) ytd current = TOTALYTD([sales current],'calendar'[Date]) ytd current 2 = CALCULATE([ytd current],FILTER('calendar','calendar'[Date]<=[end of the month]))ytd last year 1 = CALCULATE([ytd current 2],SAMEPERIODLASTYEAR('calendar'[Date])) ytd last year 2 = IF(MONTH(MAX('calendar'[Date]))<=MONTH([max date]),[ytd last year 1]) ytd last year 3 = MAXX(FILTER('calendar','calendar'[month]<=MONTH([max date])),[ytd last year 2])Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
calerof
6 years agoImpactful Individual
Hi ToffeeMark ,
Try modifying your first measure Total Sales (note earlier measure) as follows:
Total Sales = SUM( My Sales Data Table[Value Lb] )
or, you could use:
Sales YTD = CALCULATE(
[Total Sales],
DATESYTD( 'Calendar'[Date] )
)
Regards,
Fernando