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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Cannot filter on date

Hello all,

I have two huge CSV files that I have appended, but I really need to thin out the rows, as there are literally millions, So I am trying to filter anything older than 6 months, but if I try to put a filter in the query editor it sayd it cannot parse as a dateTime.

The original CSV has the date format 15/09/2017 09:52:50, and when I changed the type to Date Time, it shifted from the left to the right of the data cell, So I would expect that it has accepted the data as DateTime, but when I them try to filter the date to be anything after the 31/08/2019, it gives me the error that it cannot parse the data as DateTime.  I am not writing any manual queries for this, I am looking at the table in the Power Query editor, clicking the down arrow to the right of the column header and filtering on after, and selecting the date from the calendar.

Am I doing something stupid, or is this process just going wrong?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have figured out that the date error is itself an error, as if I change the filter to anything BEFORE 31/08/2019, it works, it just doesn't seem happy tying to filter dates after 01/09/2019.  Now I don't know if there is a limit to how many lines it can see in a CSV or if the fact that the CSV is always open and being written to all the time throws it.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I have figured out that the date error is itself an error, as if I change the filter to anything BEFORE 31/08/2019, it works, it just doesn't seem happy tying to filter dates after 01/09/2019.  Now I don't know if there is a limit to how many lines it can see in a CSV or if the fact that the CSV is always open and being written to all the time throws it.

amitchandak
Super User
Super User

Power BI setup is required to support DD/MM/YYYY kind of date. If you have done that

Then have date column to join with date table

Date = Table[Datetime].date

If you date calendar is in mm/dd/yyyy format

 

then

Date = Date(right([datetime],4),mid([datetime],4,2),left([datetime],2))

Greg_Deckler
Super User
Super User

Are you sure that you are on the last row of your query when you are trying to implement your filter? If you are on a row higher up before you converted to date time then that might be the cause. Only thing I can think of.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi, Thanks for your response.

 

Yes, it is the last action in the query.  I cannot use the DAX, as I want to get this done to the two seperate data sources befor they append together, so I need this to happen in the Query.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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