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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
GOPH
New Member

Removefilters issue

So I want to display a Matrix with Name, Year, a few categories and Cat. 2. (Additional page filters are applied)
Now for Cat. 2 rows I always want to display the Amount (Indem. GL) for Operational.
It works perfectly in a condensed form (less filters applied in the table) in _Test RC. Now putting all the filters in seems abit cumbersome so I tried doing the same with Removefilters.
However this does not work at all.

Can somebody explain why RemoveFilters does not work? And if there is another option insted of putting all Filters which should be kept in ALLEXCEPTED?

_Test RC =
CALCULATE([_Indem. GL], FILTER(
        ALLEXCEPT(G_L_Entry, Q_Employee[Name],G_L_Entry[Year]),
        G_L_Entry[Cat. 2] = "Operational"
    )
)

_Test RC2 = CALCULATE( CALCULATE([_Indem. GL], G_L_Entry[Cat. 2] = "Operational"
    ), REMOVEFILTERS(G_L_Entry[Cat. 2]))
1 ACCEPTED SOLUTION

Hello @GOPH,
You can use your dax code like that:
... ,
ALLSELECTED(G_L_Entry[Cat, 2])

That makes return all values Cat, 2 but outside filters will be effected.

İf you use ALL or REMOVEFILTERS instead of ALLSELECTED or ALLEXCEPT. That return all values and ignore everything.

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

 

View solution in original post

5 REPLIES 5
uzuntasgokberk
Super User
Super User

Hello @GOPH,

REMOVEFILTERS means also "ALL" and that means "Returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table."

But ALLSELECTED means "

Removes context filters from columns and rows in the current query, while retaining all other context filters or explicit filters.

The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries."

İf you have slicers and if you would like your values to change when you make a slicer selection. you need to use ALLSELECTED. I have a blog on that if you are interested you can follow the link:  target=_blank target=_blank target=_blank target=_blankMastering Power BI DAX Functions: From Basic...

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

 

ALLSELECTED removes all row and column context which is not what I want to happen, the figures should still be filtered based on year (cols) and name (rows), only the context of Cat. 2 should not be considered.

Hello @GOPH,
You can use your dax code like that:
... ,
ALLSELECTED(G_L_Entry[Cat, 2])

That makes return all values Cat, 2 but outside filters will be effected.

İf you use ALL or REMOVEFILTERS instead of ALLSELECTED or ALLEXCEPT. That return all values and ignore everything.

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

 

That does work for the simple measure provided.

When putting it in a more nested stmt however, it does fail again...

_Measures =

VAR ttable = SUMMARIZE(G_L_Entry,
        G_L_Entry[G_L_Entry_Employee.Source No],
        G_L_Entry[Year],
        "Montant", [_Indem. GL],
        "Montant Op", CALCULATE([_Indem. GL], G_L_Entry[Cat. 2] = "Operational", ALLEXCEPT(G_L_Entry, G_L_Entry[AnneeBud],Q_Employee[Name], Q_Employee[Mat]))
        )
VAR Result = CALCULATE(
    COUNTX(
        FILTER(ttable,[Montant Op] <= 0),
        G_L_Entry[G_L_Entry_Employee.Source No])
        )
RETURN Result

The allselected stmt wont provide the same result
 

Hello @GOPH,

 

İt is hard to say because ı don't know the relationship and some of the measure you used in your dax.

İf the below code doesn't work that would be good if you share dummy pbi file.

CALCULATE(
COUNTX(
FILTER(
SUMMARIZE(G_L_Entry,
G_L_Entry[G_L_Entry_Employee.Source No],
G_L_Entry[Year],
"Montant",
[_Indem. GL],
"Montant Op",
CALCULATE(
[_Indem. GL],
FILTER(ALLEXCEPT(G_L_Entry, G_L_Entry[AnneeBud],Q_Employee[Name], Q_Employee[Mat]), G_L_Entry[Cat. 2] = "Operational")
)
), [Montant Op] <= 0
),
G_L_Entry[G_L_Entry_Employee.Source No]
)
)

Kind Regards,
Gökberk Uzuntaş

📌 If this post helps, then please consider Accepting it as a solution and giving Kudos — it helps other members find answers faster!

🔗 Stay Connected:
📘 Medium |
📺 YouTube |
💼 LinkedIn |
📷 Instagram |
🐦 X |
👽 Reddit |
🌐 Website |
🎵 TikTok |

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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