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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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!




Anonymous
Not applicable

It works perfectly! Thanks a lot.

danextian
Super User
Super User

Hi @Anonymous ,

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.
Anonymous
Not applicable

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.