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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Applicable88
Impactful Individual
Impactful Individual

Where to put removefilters within a summarize function?

Hello,

I have a typical summarize function inside a addcolumns and Sumx function. That filter part should not react to filters of a column called DAYS. Where to put the Removefilters() inside that setting?

I tried put REMOVEFILTERS('Table1'[DAYS]) behind the Calculate average part. It does not filter correctly. I think Removefilters should already filter the Data in the filter part inside the summarzie function.

 

SUMX(

ADDCOLUMNS(

SUMMARIZE(

FILTER('Table1,

'Table1'[Month] = EDATE(MIN('momentarilyl'[Devices]),VALUE1) &&

'Table1f'[Department] = "Security" &&

'Table1'[Category] in {"Orders","Planned"} &&

'Table1'[Status] in {"progressing","open"}),

'Table1'[Orders]),

"AVG",

CALCULATE(

AVERAGE('Table1'[Sales]),

[AVG]))

 

Thank you very much in advance.

Best. 

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Please share some data, describe the question and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur , sorry I have no sample data. In general the above calculatio works perfectly. The only thing I need to add is that it disregard selections or filtering of the Column 'Days'.

 

I tried the example from @Icey  and add the removefilters() with a calculatetable filter:

Measure =
SUMX (
ADDCOLUMNS (
CALCULATETABLE (
SUMMARIZE (
FILTER (
'Table1',
'Table1'[Month] = EDATE ( MIN ( 'momentarilyl'[Devices] ), VALUE1 )
&& 'Table1f'[Department] = "Security"
&& 'Table1'[Category]
IN { "Orders", "Planned" }
&& 'Table1'[Status] IN { "progressing", "open" }
),
'Table1'[Orders]
),
REMOVEFILTERS ( 'Table1'[DAYS] )
),
"AVG", CALCULATE ( AVERAGE ( 'Table1'[Sales] ) )
),
[AVG]
)


 But unfortunately whenever I filter something in the "Days" Slicer it still filters the Data accordingly which I want it to ignore. 

Maybe you have an idea?

Best. 

 

Anonymous
Not applicable

The formula does not even want to get formatted by www.daxformatter.com 

Sorry, I forgot to input the name of the measure. Now the syntax is right:

 

Measure =
SUMX (
    ADDCOLUMNS (
        SUMMARIZE (
            FILTER (
                'Table1',
                'Table1'[Month] = EDATE ( MIN ( 'momentarilyl'[Devices] ), VALUE1 )
                    && 'Table1f'[Department] = "Security"
                    && 'Table1'[Category]
                    IN { "Orders", "Planned" }
                    && 'Table1'[Status] IN { "progressing", "open" }
            ),
            'Table1'[Orders]
        ),
        "AVG", CALCULATE ( AVERAGE ( 'Table1'[Sales] ) )
    ),
    [AVG]
)

 

Measure =
SUMX (
ADDCOLUMNS (
SUMMARIZE (
FILTER (
'Table1',
'Table1'[Month] = EDATE ( MIN ( 'momentarilyl'[Devices] ), VALUE1 )
&& 'Table1f'[Department] = "Security"
&& 'Table1'[Category]
IN { "Orders", "Planned" }
&& 'Table1'[Status] IN { "progressing", "open" }
),
'Table1'[Orders]
),
"AVG", CALCULATE ( AVERAGE ( 'Table1'[Sales] ) )
),
[AVG]
)

Hi @Applicable88 ,

 

How about this?

Measure =
SUMX (
    ADDCOLUMNS (
        CALCULATETABLE (
            SUMMARIZE (
                FILTER (
                    'Table1',
                    'Table1'[Month] = EDATE ( MIN ( 'momentarilyl'[Devices] ), VALUE1 )
                        && 'Table1f'[Department] = "Security"
                        && 'Table1'[Category]
                        IN { "Orders", "Planned" }
                        && 'Table1'[Status] IN { "progressing", "open" }
                ),
                'Table1'[Orders]
            ),
            REMOVEFILTERS ( 'Table1'[DAYS] )
        ),
        "AVG", CALCULATE ( AVERAGE ( 'Table1'[Sales] ) )
    ),
    [AVG]
)

Measure =
SUMX (
ADDCOLUMNS (
CALCULATETABLE (
SUMMARIZE (
FILTER (
'Table1',
'Table1'[Month] = EDATE ( MIN ( 'momentarilyl'[Devices] ), VALUE1 )
&& 'Table1f'[Department] = "Security"
&& 'Table1'[Category]
IN { "Orders", "Planned" }
&& 'Table1'[Status] IN { "progressing", "open" }
),
'Table1'[Orders]
),
REMOVEFILTERS ( 'Table1'[DAYS] )
),
"AVG", CALCULATE ( AVERAGE ( 'Table1'[Sales] ) )
),
[AVG]
)

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Applicable88
Impactful Individual
Impactful Individual

@Icey , thanks for the effort. There is a mistake in the syntax. I tried different variations and change the comma and the paranthesis, but cannot find whats wrong. Not even daxformatters can it be formatted. Is it really possible to put the Removefilters there when before is a calculatedtable ?

Hi @Applicable88 ,

 

Do you mean this error?

error.PNG

 

If so, just re-enter the equal sign "=".

 

equal.gif

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Applicable88
Impactful Individual
Impactful Individual

Hello, @Icey Okay, thank you very much. Thats a weird bug in Daxformatters...

 

But the calculation still don't react to changes in the filters of "DAYS". So is there maybe something else other than Removefilters() that can to let the calculation ignore selection from "DAYS"?

 

 

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.