Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi good day can anyone help me on my PQ, i want to change below to date column and filter previous week and current week dynamically.
Thank you
Solved! Go to Solution.
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
更改的类型 = Table.TransformColumnTypes(源,{{"dt", type text}}),
已添加自定义 = Table.AddColumn(更改的类型, "自定义", each Date.FromText([dt], [Format="dd'th' MMMM yyyy", Culture=""])),
筛选的行 = Table.SelectRows(已添加自定义, each Date.IsInPreviousWeek([自定义]) or Date.IsInCurrentWeek([自定义]))
in
筛选的行
let
源 = Excel.CurrentWorkbook(){[Name="表1"]}[Content],
更改的类型 = Table.TransformColumnTypes(源,{{"dt", type text}}),
已添加自定义 = Table.AddColumn(更改的类型, "自定义", each Date.FromText([dt], [Format="dd'th' MMMM yyyy", Culture=""])),
筛选的行 = Table.SelectRows(已添加自定义, each Date.IsInPreviousWeek([自定义]) or Date.IsInCurrentWeek([自定义]))
in
筛选的行
Replace "st", "nd" and "rd" with "", then change the data type of the column to Date.
If that doesn't work change the locale in the Power Query options to English(USA) or English(UK).
Now you're able to filter the column as you like.
Andreas.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 3 |