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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
HLVW
Helper I
Helper I

Measure for LY that ignores select filter

Hi.
 
I am trying to calculate a measure for a matrix, showing total LY figures. I have 2 slicers, Month & Year. If I select f.ex. 2024 and month May, I would like the new measure to show full 2023 and not only YTD May 2023.
I have tried with ALLEXCEPT, but with no luck....
Current measure: LY Full year = CALCULATE(-SUM('Finance Transactions_V'[Amount]), SAMEPERIODLASTYEAR(Date_V[Date]),ALLEXCEPT(Date_V, Date_V[Year Number]))
 
Thanks a lot in advance.
1 ACCEPTED SOLUTION
_AAndrade
Super User
Super User

Hi,

 

Please try this:

VAR Year = MAX(Date_V[Year Number])

RETURN

CALCULATE(
    "Your Sum Measure",
    REMOVEFILTERS(Date_V),
    DATESBETWEEN(Date_V[Date],DATE(Year -1,1,1),DATE(Year -1,12,31))
)






Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




View solution in original post

4 REPLIES 4
_AAndrade
Super User
Super User

Hi,

 

Please try this:

VAR Year = MAX(Date_V[Year Number])

RETURN

CALCULATE(
    "Your Sum Measure",
    REMOVEFILTERS(Date_V),
    DATESBETWEEN(Date_V[Date],DATE(Year -1,1,1),DATE(Year -1,12,31))
)






Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




It works perfectly! Thanks a lot.

danextian
Super User
Super User

Hi @HLVW ,

Do you intend to show the value for each past x months as well and not just the correct selected month? You will need a disconnected dates/calendar table for that as using the one related to your fact table will just show what is selected. Please see attached sample pbix.

danextian_0-1711448092887.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks a lot for your reply. I would like a matrix visual as below, where the right column is full last year in spite of filters. I already have a date table, but this is connected...

HLVW_0-1711448454771.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.