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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
oupepasa
Frequent Visitor

Problem with sameperiodlastyear

I can't do a small table that gives me sales and last year sales by category,

 

here is the measure that stays empty each time i choose a filter, if i don't have any filter it's working, i have my sales till end of 2020

Last year Sales = 
VAR Val = CALCULATE(SUM('PBI Sales'[Sales price]), SAMEPERIODLASTYEAR('PBI Date'[Date]) )
VAR Result = if(ISBLANK(Val),0,Val)
RETURN     Result

 

Please help i feel so dumb right now i don't understand why it's not working .

 

 

here is the image of the table , i'm not always easy to understand , that may help

https://ibb.co/WP4M7gL

 

 

1 ACCEPTED SOLUTION

I finally found my problem, i didn't mark PBI table as date table.

View solution in original post

5 REPLIES 5
BA_Pete
Super User
Super User

Hi @oupepasa ,

 

Is your page slicer using [Year] from your 'PBI Date' table, or from your fact table? If it's from your fact table, then you need to switch it to 'PBI Date'[Year] as it may be an issue with relationship filters not being able to be passed from the fact table to the date table due to filter direction.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Thanks for your answer, but my slicer is from my 'PBI date' table

@oupepasa ,

 

Ok. Are you able to share an example of your data and a picture of the relevant parts of your data model please?

 

If so, make sure to remove any sensitive information from the data sample.

 

Thanks,

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




here is a picture of the table i use here

 

https://ibb.co/cwhgQzk

 

I finally found my problem, i didn't mark PBI table as date table.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.