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.
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)
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 |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |