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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
t-dahen
Microsoft Employee
Microsoft Employee

Remove All Filters but Specify New Filter

Hello,

 

Is there a way to remove all filters but specify a new filter inside a dax expression?

 

 

For example, what I would think to do is:

 

 

 

Measure = Calculate(SUM(Table[row1]), Table[row2] = "Something", ALLEXCEPT(Table, Table[row2]))

 

 

 

1 ACCEPTED SOLUTION

Try this. I used the logic I gave for the total, then used a slight different logic for the current total used as the numerator.

Type A Total =
VAR varTypeATotal =
    SUMX(
        FILTER(
            ALL( 'Data Table' ),
            'Data Table'[Type] = "A"
        ),
        'Data Table'[Total]
    )
VAR varCurrentTotal =
    SUMX(
        FILTER(
            'Data Table',
            'Data Table'[Type] = "A"
        ),
        'Data Table'[Total]
    )
VAR varPercentOfTotal =
    DIVIDE(varCurrentTotal, varTypeATotal, 0)
RETURN
    varPercentOfTotal

 

 

 

edhans_0-1593543880987.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

View solution in original post

7 REPLIES 7
edhans
Super User
Super User

Will this do what you need?

Measure =
CALCULATE(
    SUM( Table[row1] ),
    FILTER(
        ALL( Table ),
        Table[Row2] = "Something"
    )
)

It removes the filter from table, then returns only where the [Row2] field = "Something" 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
t-dahen
Microsoft Employee
Microsoft Employee

Hmm, the measure filters based on "row2", but when I select a filter the measure changes. This makes it seem the ALL(Table) is not working.

You'll need to give more info, or perhaps share a PBIX file with some sample data.

How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
t-dahen
Microsoft Employee
Microsoft Employee

@edhans 
My data looks like this:

 

NameTypeTotal
BobA1
BobB2
AliceA3
AliceB4

 

I want an absolute count of Total for Type "A". In this case it will be 4. If I have a Name filter in my report and select "Bob", I do not want this measure to be 1, still 4. 

My end goal is to have for each Name, the percentage they account for in Type "A". Note there is no Type context below.

 

NamePercentageInA
Bob.25
Alice.75

Try this. I used the logic I gave for the total, then used a slight different logic for the current total used as the numerator.

Type A Total =
VAR varTypeATotal =
    SUMX(
        FILTER(
            ALL( 'Data Table' ),
            'Data Table'[Type] = "A"
        ),
        'Data Table'[Total]
    )
VAR varCurrentTotal =
    SUMX(
        FILTER(
            'Data Table',
            'Data Table'[Type] = "A"
        ),
        'Data Table'[Total]
    )
VAR varPercentOfTotal =
    DIVIDE(varCurrentTotal, varTypeATotal, 0)
RETURN
    varPercentOfTotal

 

 

 

edhans_0-1593543880987.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
t-dahen
Microsoft Employee
Microsoft Employee

Perfect, thanks!

Similarily related, is getting a percentage breakdown for a Measure across all the names possible?

 

So for Bob and Alice, let's say an arbitrary measure returns 60 and 40 respectively. Can I get:

 

NamePercentWithMeasure
Bob.60
Alice.40

Yes. that will depend on the filter context of the visual, but table like you have will work fine.

 

Percent by Name =
VAR varGrandTotal =
    SUMX(
        ALL( 'Data Table' ),
        'Data Table'[Total]
    )
VAR varCurrentTotal =
    SUM( 'Data Table'[Total] )
VAR varPercentOfTotal =
    DIVIDE(
        varCurrentTotal,
        varGrandTotal,
        0
    )
RETURN
    varPercentOfTotal

 

 

edhans_0-1593556022856.png

 



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.