Results 1 to 1 of 1

Thread: PQ - tip of the day

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sir Moderator sandy666's Avatar
    Join Date
    May 2018
    Posts
    238
    Rep Power
    7

    Cool PQ - tip of the day

    FName
    Bob


    Code:
    // 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:
    qprop.png
    Last edited by sandy666; 07-12-2023 at 03:41 AM.
    sandy
    I know you know but I forgot my Crystal Ball and don't know what you know also I may not remember what I did weeks, months or years ago so answer asap. Thinking doesn't hurt

Similar Threads

  1. PQ - Count selected day between dates
    By sandy666 in forum ETL PQ Tips and Tricks
    Replies: 0
    Last Post: 05-09-2020, 09:03 PM
  2. Nth Such-And-Such Day Of The Month
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 6
    Last Post: 01-02-2020, 06:48 PM
  3. a ongoing 30 day total
    By justme1052 in forum Excel Help
    Replies: 1
    Last Post: 05-23-2014, 08:10 AM
  4. Date Format From Start Day To End Day
    By PcMax in forum Excel Help
    Replies: 2
    Last Post: 03-10-2013, 02:07 PM
  5. How To Use getKeytip to Assign the Key Tip of a Ribbon Tab
    By Excel Fox in forum Excel Ribbon and Add-Ins
    Replies: 0
    Last Post: 04-19-2011, 11:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •