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
eaglesilo
Regular Visitor

DAX RemoveFilters issue --SOLVED

I am trying to get a RemoveFilters function to work. 

Basically, I want to get a Count of ID in QtData for a specific EquipmentGroup and TimePeriod that ignores any Slicers that impact the Visual Page.  As it's ignoring the Slicers, however, I would like to get a count of all the values created in the past 6 months.  Below is what I have:

 

 

M_6MonthQtCt_Type1-Type2 = 
CALCULATE (
    COUNT ( QtData[Id] ),
    FILTER (
        ALL ( EquipmentSelect ),
        EquipmentSelect[TypeGrouping] IN { "Type1", "Type1" }
    ),
    FILTER ( ALL ( 'QtData' ), QtData[qtDate] >= 'Calendar'[M_6MonthsPrev] )
)

 

 

with M_6MonthsPrev as:

 

 

M_6MonthsPrev = EDATE(TODAY(), -6)

 

 

 

I've inlcuded the Data Model below and highlighted the various relations.  In the DAX I have so far, I'm only trying to remove the filters on the EquipmentSelect and Calendar table (since I can't get this simple version to work for me yet) but I will eventually add in REMOVEFILTERS, or whatever the correct process is, to remove QtType, QtStatus, EmployeeTeam, and PartnerName, and the filters to PartnerName.

Look forward to any insights on what I'm doing incorrectly here!

eaglesilo_1-1692026069155.png


***Edit:  As a note, I need to use Calculate, instead of, say, a CountRows (if that would work), as I'll also want to get the SUM of QuotedValue at a later time.

 

 

 

UPDATE:  Solution found

M_6MonthQtCt_Type1-Type2 = 
CALCULATE ( COUNT ( QtData[Id] )
    , ALL(DateRangePicker) 
    , FILTER ( ALL ( 'QtData' )
    , QtData[qtDate] >= 'Calendar'[M_6MonthsPrev] ) 
    , EquipmentSelect[TypeGrouping] IN { "Type1", "Type2" } 
)

Greg's solution probably would have worked, but found this before figuring out how to implement my solution.

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@eaglesilo Let's say that Type1 and Type2 have ID's of 1 and 2, you could do this:

M_6MonthQtCt_Type1-Type2 = 
  VAR __Table = FILTER( ALL( 'QtData'), EquipmentTypeId IN { 1, 2 } && [qtDate] >= [M_6MonthsPrev])
  VAR __Result = COUNTROWS( __Table )
RETURN
  __Result

If later you want to do a SUM, then you could replace COUNTROWS with SUMX.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Ended up with the below as the solution:

M_6MonthQtCt_Type1-Type2 = 
CALCULATE ( COUNT ( QtData[Id] )
    , ALL(DateRangePicker) 
    , FILTER ( ALL ( 'QtData' )
    , QtData[qtDate] >= 'Calendar'[M_6MonthsPrev] ) 
    , EquipmentSelect[TypeGrouping] IN { "Type1", "Type2" } 
)

 

I think your solution would have worked, but EquipmentType.TypeGrouping contains many TypeIDs and this allows for the IDs in the group to change server side and flow through to PBI.  (The EquipmentSelect table is pulled directly from SQL and managed and updated within there)

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.