Forum Discussion
Filter SQL view data in Power Query
- 2 years ago
Hi, it looks like the view in the database uses a varchar column to hold date type, and string literal 'Not Provided' is put in the column for missing case, instead of using a date type column with null allowed. If that's the case, to fix the issue in the source is the best solution.
If that's impossbile for whatever reason, you can load the data and do cleaning & transformation with M.
- Load all the data, including those 'Not Provided' records.
- Use Table.SelectRows to select the rows you need. One dummy solution is to define a function to check that date column and only returns true if the column contains a date value text, and that date text is greater than 20240630
That't my two cents. You may have another implementation for loading and filtering the data with M.
Hi, it looks like the view in the database uses a varchar column to hold date type, and string literal 'Not Provided' is put in the column for missing case, instead of using a date type column with null allowed. If that's the case, to fix the issue in the source is the best solution.
If that's impossbile for whatever reason, you can load the data and do cleaning & transformation with M.
- Load all the data, including those 'Not Provided' records.
- Use Table.SelectRows to select the rows you need. One dummy solution is to define a function to check that date column and only returns true if the column contains a date value text, and that date text is greater than 20240630
That't my two cents. You may have another implementation for loading and filtering the data with M.
It took me some time to get all the data and I figured out the issue in some columns -- so many columns like 70+ and 20+ are int, crushed again and again with my 32G memory lol .
And it works. Thank you so much for your help.