Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I am trying to compare YTD (1) production at the selected Financial Year and Financial month filtered with a the following slicer
(Slicer Year = FY19 / Slicer Month = March) with last year in the same month LYTD (2).
(1) YTD Production = calculate([Production];datesytd('Calendar'[Date];"30/06") -
(2) LYTD = calculate([YTD Production];SAMEPERIODLASTYEAR('Calendar'[Date]))
Then I want to compare also with last full year (FY18, from 01/07/17 to 30/06/18) and FY17 (from 01/07/16 to 30/06/17). How could I do this?
Thank you very much for your help
Reubben
Solved! Go to Solution.
You could write a custom time intelligence functions to do this
Sales Current Year = VAR CurrentYear = MAX ( calendar[year] ) RETURN CALCULATE ( [Total Sales], FILTER ( ALL ( calendar ), calendar[Year] = CurrentYear ) )
and this
Sales Last Year = VAR CurrentYear = MAX ( calendar[year] ) VAR LastYear = CurrentYear - 1 RETURN CALCULATE ( [Total Sales], FILTER ( ALL ( calendar ), calendar[Year] = LastYear) )
You can read my article about time intelligence in Power BI here
Thank you very much for answering. Following your tip I have applied your measure to my model and it gives me a wrong result as I am working with fiscal year ( from 1s july to 30th june). Following the logical, if I change Calendar[Year] for Calendar[FiscalYear], the result is an error. May be is because Calendar[FiscalYear] in the calendar table is difined as FY16, FY17... FY20, but I don´t know how to solve it.
By the way, I have take a look to your article and I find it very interesting. Its very helpfull for newbies like me.
Production Last Year = VAR CurrentYear = MAX ( calendar[FiscalYear] ) VAR LastYear = CurrentYear - 1 RETURN CALCULATE ( [Produccion]; FILTER ( ALL ( 'Calendar' ); 'Calendar'[FiscalYear] = LastYear) )
You could write a custom time intelligence functions to do this
Sales Current Year = VAR CurrentYear = MAX ( calendar[year] ) RETURN CALCULATE ( [Total Sales], FILTER ( ALL ( calendar ), calendar[Year] = CurrentYear ) )
and this
Sales Last Year = VAR CurrentYear = MAX ( calendar[year] ) VAR LastYear = CurrentYear - 1 RETURN CALCULATE ( [Total Sales], FILTER ( ALL ( calendar ), calendar[Year] = LastYear) )
You can read my article about time intelligence in Power BI here
Thank you very much for answering. Following your tip I have applied your measure to my model and it gives me a wrong result as I am working with fiscal year ( from 1s july to 30th june). Following the logical, if I change Calendar[Year] for Calendar[FiscalYear], the result is an error. May be is because Calendar[FiscalYear] in the calendar table is difined as FY16, FY17... FY20, but I don´t know how to solve it.
By the way, I have take a look to your article and I find it very interesting. Its very helpfull for newbies like me.
Production Last Year = VAR CurrentYear = MAX ( calendar[FiscalYear] ) VAR LastYear = CurrentYear - 1 RETURN CALCULATE ( [Produccion]; FILTER ( ALL ( 'Calendar' ); 'Calendar'[FiscalYear] = LastYear) )
You need an integer FY column. Just add one to your calendar as a calc column
FY = right(calendar[fiscalyear],2)
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
136 | |
113 | |
102 | |
71 | |
60 |