Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
I have created a custom step in Power Query to filter a table (table in Filtered Rows1) where the date created is teh second Monday of the month.
The issue is Power Query just colors the code red in the formula bar and outputs the code rather than a filtered table
let
Source = #"Filtered Rows1",
FirstDayOfMonth = Date.StartOfMonth(DateTime.LocalNow()),
FirstDayOfWeek = Date.StartOfWeek(FirstDayOfMonth, Day.Monday),
SecondWeekStart = Date.AddDays(FirstDayOfWeek, 7),
SecondWeekEnd = Date.AddDays(SecondWeekStart, 6),
FilteredTable = Table.SelectRows(Source, each [Date created] >= SecondWeekStart and [Date created] <= SecondWeekEnd)
in
FilteredTable
pls try this
let
Source = Date,
FirstDayOfMonth = Date.StartOfMonth(DateTime.LocalNow()),
FirstDayOfWeek = Date.StartOfWeek(FirstDayOfMonth, Day.Monday),
SecondWeekStart = Date.From( Date.AddDays(FirstDayOfWeek, 7)),
SecondWeekEnd = Date.From( Date.AddDays(SecondWeekStart, 6)),
FilteredTable = Table.SelectRows(Source, each [Date created] >= SecondWeekStart and [Date created] <= SecondWeekEnd)
in
FilteredTable
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |