PDA

View Full Version : PQ - tip of the day



sandy666
07-12-2023, 02:51 AM
FName


Bob



// Name4Today
let
Source = Table.FromRecords({
[DOW = "Monday", Name = "Bob"],
[DOW = "Tuesday", Name = "Bob"],
[DOW = "Wednesday", Name = "Jill"],
[DOW = "Thursday", Name = "Jill"],
[DOW = "Friday", Name = "Jill"],
[DOW = "Saturday", Name = "Bob"],
[DOW = "Sunday", Name = "Bob"]
}),
Now = Table.AddColumn(Source, "Now", each Date.DayOfWeekName(DateTime.LocalNow())),
IF = Table.AddColumn(Now, "FName", each if [DOW] = [Now] then [Name] else null),
TSR = Table.SelectRows(IF, each [FName] <> null),
TSC = Table.SelectColumns(TSR,{"FName"})
in
TSC

Name can be changed to Tip for each DayOfWeek
in Query Properties select:
5098