Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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.