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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AlexanderMeneik
Regular Visitor

Date filter not ignored despite ALL and REMOVEFILTERS

Hello, with my first question here I had bitten of a lot more that I could chew, so today I am asking about a smaller step in my DAX learning process.

 

I try to calculate a First Order Date from an Invoices table. 

 

This is my calendar DAX:

DateTable = ADDCOLUMNS(CALENDARAUTO(),
"MonthNo", MONTH([Date]),
"MonthName", FORMAT([Date],"MMMM"),
"Quarter", QUARTER([Date]),
"Year", YEAR([Date]), "Day", DAY([Date]), "WeekdayNum", WEEKDAY([Date]), "WeekdayName",FORMAT([Date],"DDDD"), "YearMonth", FORMAT([Date], "YYYY-MM"), "YearQuarter", FORMAT([Date], "YYYY-Q"))

 

So far, I have tried a few variations. At the moment, I have tried this code:

FirstOrderDate = CALCULATE(MIN('invoices_2019-2022'[Date Initiated]), 
ALL(DateTable[Date]))

 

That works fine as long as I have not selected any quarter in the slicer.

 

AlexanderMeneik_0-1706858854919.png

 

Yet, as soon as I select a YearQuarter, the results change, and I get the First Order Date in the context of the slicer, despite the ALL function.

 

AlexanderMeneik_1-1706858952013.png

 

Before, I had tried this:

 

FirstOrderDate = CALCULATE(MIN('invoices_2019-2022'[Date Initiated]), 
REMOVEFILTERS(DateTable[Date]))

 

Same result.

 

As you can probably tell, I have about a 5-year-old's underdstanding of DAX, so please explain in a simple way.

 

Thanks a lot.

1 ACCEPTED SOLUTION
AlexanderMeneik
Regular Visitor

Looks like the solution was pretty simple - I need to use REMOVEFILTERS on the whole table, not just the [Date] column:

 
FirstOrderDate = CALCULATE(MIN('invoices_2019-2022'[Date Initiated]),
REMOVEFILTERS(DateTable))

 

That did the trick.

 

View solution in original post

1 REPLY 1
AlexanderMeneik
Regular Visitor

Looks like the solution was pretty simple - I need to use REMOVEFILTERS on the whole table, not just the [Date] column:

 
FirstOrderDate = CALCULATE(MIN('invoices_2019-2022'[Date Initiated]),
REMOVEFILTERS(DateTable))

 

That did the trick.

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.