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.
Hi there,
I am trying to find out the YTD of last two years separately so that i can find out the trend in sales over the years in respective months. My sales table has transaction starting from 01-01-2013 till 31-08-2017. I have calculated the YTD of current year i.e 2017 till August. I am still scratching my head to find out a way to calculate YTD for last 2 years separately i.e for 2016 & 2015.
Kindly find below my Current_year_YTD Measure.
Current_year_YTD = if(min(datetable(date) <=calculate(max(sales(date)),all(sales)),
calculate([sales_measure],filter(all(datetable(date)),datetable(date)<=max(datetable(date)),blank())
Note -- >
** I have a dedicated date table that starts at 01-01-2013 & ends at 31-12-2018
** Sales_Measure is the measure that calculates the sum of sales
Any ideas how can i calculate the YTD of last years???
Regards,
Hemant
Curious why you are not using TOTALYTD?
https://msdn.microsoft.com/en-us/library/ee634400.aspx
I tried using it total ytd before posting here but the result i am getting is good to see in matrix visual for all the years. I need to do more calcuation for which i need separate YTD's.
Any more guesses,how can i calculate the ytd for three different years separately???
Regards
Hemant
How about creating a TOTALYTD measure, then using the parallelperiod to calculate the two years before it, like so:
YTD Current Year = TOTALYTD(Table[Column];'Date'[Date])
YTD Last Year = CALCULATE([YTD Current Year];PARALLELPERIOD('Date'[Date];-12;MONTH))
YTD Two Years Back = CALCULATE([YTD Current Year];PARALLELPERIOD('Date'[Date];-24;MONTH))
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 |
---|---|
107 | |
98 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |