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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
RK_JOB
Helper II
Helper II

Filter Context Not working with calculate

Hello,

I am in a pickle here.

I had to append two tables to use it as Dimension table but I am not getting the correct answer when I introduce YEAR in the mix.

 

Correct Result:

 

RK_JOB_1-1666132764467.png

 

Wrong Result: When I introduce Year to the mix.

 

 

 

RK_JOB_0-1666132723648.png

 

My measures are dependent on date from DATE table which is different from Append Table but there is a relationship with my fact table so not sure why it doesn't work as expected?

 

You can download the pbix from here.

https://drive.google.com/file/d/15cOobU8vzH9jQTdM_kYIiL6s48KBAmbd/view?usp=sharing

 

Thanks,

EZ

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @RK_JOB ,

 

Please try:

Last Year = 
VAR _max_date =
    SELECTEDVALUE ( 'Append1'[YEAR] )
VAR _last_year =
    CALCULATE ([This Year],Append1[YEAR] = _max_date - 1)
RETURN
    _last_year

vcgaomsft_0-1666172292891.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @RK_JOB ,

 

Please try:

Last Year = 
VAR _max_date =
    SELECTEDVALUE ( 'Append1'[YEAR] )
VAR _last_year =
    CALCULATE ([This Year],Append1[YEAR] = _max_date - 1)
RETURN
    _last_year

vcgaomsft_0-1666172292891.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.