Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
kilala
Resolver I
Resolver I

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 = 

Amount SPLY =
CALCULATE([Actual Amount, SAMEPERIODLASTYEAR(vw_DimDate[Date]))
 
hope can find a way to solve this. thankssss
1 ACCEPTED SOLUTION
kilala
Resolver I
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-365
var 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)
return
CALCULATE(
[Actual Amount],
SPLYUntillastdate)

View solution in original post

2 REPLIES 2
kilala
Resolver I
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-365
var 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)
return
CALCULATE(
[Actual Amount],
SPLYUntillastdate)
amitchandak
Super User
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-bd52912a5b...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors