+ Reply to Thread
Results 1 to 4 of 4

Power Query Filter Column

  1. #1
    Registered User
    Join Date
    01-23-2020
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    37

    Power Query Filter Column

    Hi,

    I`m trying to write a query in power query and have an issue. In the input table I have two columns - "Work Schedule Hours" and "Hours". Within "Get and Transform" I would like to add a custom column which does two things:

    1. Divides Column "hours" by "work schedule (hours)" to give a number - 1 or less (based on report this will always be less than 1). Lets name the custom column "Days Absent"
    2. I would then like to filter with two rules which are basically if Column "Abs. code" is PTMG then keep the row regardless of the figure in column "Days Absent", however, if the "Abs. code" column contains any other info then discard the row(s) if the figure in "Days absent" column is less than 1

    Please can someone look. Have attached a data file with a query which creates the extra column "days absent" but does not filter out the rows.

    Thanks,

    B
    Attached Files Attached Files

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Power Query Filter Column

    You can add a custom column using this calculation:

    if [Abs. code] <> "PTMG" and [Days Absent] < 1 then false else true

    and then filter that new column for true.
    Rory

  3. #3
    Registered User
    Join Date
    01-23-2020
    Location
    United Kingdom
    MS-Off Ver
    2016
    Posts
    37

    Re: Power Query Filter Column

    Thanks rorya,

    Thats worked perfectly!!

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,915

    Re: Power Query Filter Column

    Glad to help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  2. [SOLVED] Power Query Filter by Date Parameter
    By tkrupka in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-16-2019, 10:08 AM
  3. [SOLVED] Power Pivot does not load new column added in Power query
    By ibuhary in forum Excel General
    Replies: 12
    Last Post: 02-19-2019, 03:53 AM
  4. If paramater in Power Query is blank do not filter
    By Harveyhirst1 in forum Excel General
    Replies: 3
    Last Post: 09-18-2018, 06:59 PM
  5. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM
  6. [SOLVED] Power Query Filter All Rows After Prior Month
    By Tayque_J_Holmes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-19-2018, 11:31 AM
  7. Power Query - Filter by Date
    By brent_milne in forum Excel General
    Replies: 0
    Last Post: 03-16-2017, 10:39 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1