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 All,
My Fisical year starts from July 1st untill Jun 30ty of the next year.
for exmaple the date 01-APR-2016 in in year 2016 but in fisical year 2015 (wich starts from 01-July-2015 and ends at 30-Jun-2016.
I am trying to have the YTD and previous YTD to work but, I need it to calculate up to the last load date for current YTD and up to the last load date minus 1 year, for the YTD of the privious year.
since my date table has values later then the current date (aka sysdate), when I apply the SAMEPIRIODLASTYEAR to the YTD of the current year, I get values later then the current sysdate minus 1 year.
my measures :
TotalYTD_Fisical =
VAR CurrentDate=NOW()
RETURN
IF(HASONEVALUE(DimDates[FisicalYear])=TRUE(),
CALCULATE([TotalSales],
FILTER(DATESYTD(DimDates[DateKey],"30/06")
,DimDates[DateKey]<=CurrentDate
)
)
)
TotalYTD_Fisical-PrevYear =
IF(HASONEVALUE(DimDates[FisicalYear])=TRUE(),
CALCULATE([TotalYTD_Fisical],SAMEPERIODLASTYEAR(DimDates[DateKey]))
)
I would have expected to see from the start of the red rectangle till the end the same value as from 201611 prev year : 148,521,637
what am I misssing ?
thanks
If the DimDates table has relationship with Fact table with DateKey here. You can create two columns of YearMonth and FisicalYear in your fact table (Table1) with following formulas.
YearMonth = YEAR ( Table1[Date] ) * 100 + MONTH ( Table1[Date] )
FisicalYear = RELATED ( DimDates[FisicalYear] )
Then drag these two column instead of columns in DimDates into Table chart as below.
In my test Table1, 11/2/2016 is the last load date, 5823 is the total YTD until 11/2/2015. (6731 is the total YTD until 11/30/2015)
Best Regards,
Herbert
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 |