Forum Discussion
Why SPLY doesnt work when I filter?
Hello all,
I wonder why my SPLY doesnt work when user select one month. For example, when user select March, I want to see the actual amount vs last year amount (march). but the value showed is blank. I am so confused.
Here is my SPLY measure =
It's okay all, maybe there is error with my measure. I changed to this and it works:
Selected Parameter Value Actual SPLY =var lastdateAvailable=CALCULATE(MAX(vw_FactSales[Date]),ALL(vw_FactSales)var lastyearsameday=lastdateAvailable-365var ifLY=IF(DAY(lastyearsameday)<>DAY(lastdateAvailable),TRUE(),FALSE())var lastyearsamedayLY=IF(ifLY,lastdateAvailable-366,lastyearsameday)var SPLYUntillastdate=FILTER(SAMEPERIODLASTYEAR(vw_DimDate[Date].[Date]),vw_DimDate[Date].[Date]<=lastyearsamedayLY)returnCALCULATE([Actual Amount],SPLYUntillastdate)
2 Replies
- amitchandak
Super User
kilala , Make sure date table is marked and date table and and date table has all required joins
this measure should work, assuming [Actual Amount] is a measure
Amount SPLY =
CALCULATE([Actual Amount], SAMEPERIODLASTYEAR(vw_DimDate[Date]))Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5bd4 - kilala
Resolver I
It's okay all, maybe there is error with my measure. I changed to this and it works:
Selected Parameter Value Actual SPLY =var lastdateAvailable=CALCULATE(MAX(vw_FactSales[Date]),ALL(vw_FactSales)var lastyearsameday=lastdateAvailable-365var ifLY=IF(DAY(lastyearsameday)<>DAY(lastdateAvailable),TRUE(),FALSE())var lastyearsamedayLY=IF(ifLY,lastdateAvailable-366,lastyearsameday)var SPLYUntillastdate=FILTER(SAMEPERIODLASTYEAR(vw_DimDate[Date].[Date]),vw_DimDate[Date].[Date]<=lastyearsamedayLY)returnCALCULATE([Actual Amount],SPLYUntillastdate)