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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jbeans
Frequent Visitor

Calculate SUM of Current Year Ignoring Any Filters/ Slicers

Hi Guys 

 

Apologies this is probably a basic query however I am looking to get the SUM of a column that contains the SUM only for the current year while ignoring any filtering/ slicers. It would be great if the measure could dynamically look at the current year. 

 

Please see what I have below - it works until the slicer is applied. 

 

Thanks 

 

 

JU Year End 2023 = 
CALCULATE(
    SUM('Current Day'[JU]), 
    FILTER(
        ALL('Date Table'[Year]), 
        'Date Table'[Year] = "2023"
    )
)

 

2 ACCEPTED SOLUTIONS
DOLEARY85
Super User
Super User

Hi,

 

if you add, remove filters for whichever table you need to remove them from, to the line before your new filter e.g:

 

JU Year End 2023 = 
CALCULATE(
    SUM('Current Day'[JU]), 
    REMOVEFILTERS('Current Day'),
    FILTER(
        ALL('Date Table'[Year]), 
        'Date Table'[Year] = "2023"
    )
)
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

View solution in original post

jbeans
Frequent Visitor

@DOLEARY85  just as I replied I figured it out 🤣 You syntax is correct, I just switched around the table to the date table I was using and that seemed to get it. Thanks for your help 

JU Year End 2023 = 
CALCULATE(
    SUM('Current Day'[JU]), 
    REMOVEFILTERS('Date Table'),
        'Date Table'[Year] = "2023"
    )

View solution in original post

5 REPLIES 5
DOLEARY85
Super User
Super User

Hi,

 

if you add, remove filters for whichever table you need to remove them from, to the line before your new filter e.g:

 

JU Year End 2023 = 
CALCULATE(
    SUM('Current Day'[JU]), 
    REMOVEFILTERS('Current Day'),
    FILTER(
        ALL('Date Table'[Year]), 
        'Date Table'[Year] = "2023"
    )
)
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Thanks for quick reply, correct that does remove filtering however it looks like 

        'Date Table'[Year] = "2023"

Is not being picked up and previous years are now coming in to the SUM() as a result - any ideas? 

Are you able to share the PBIX file? i've only been able to create a limited test based on the fields available in the measure which seems to work.

Hi @DOLEARY85  I don't think I can as it is pretty confidential financial data. I will keep looking and can update this thread if I find a solution. 

jbeans
Frequent Visitor

@DOLEARY85  just as I replied I figured it out 🤣 You syntax is correct, I just switched around the table to the date table I was using and that seemed to get it. Thanks for your help 

JU Year End 2023 = 
CALCULATE(
    SUM('Current Day'[JU]), 
    REMOVEFILTERS('Date Table'),
        'Date Table'[Year] = "2023"
    )

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.