Results 1 to 1 of 1

Thread: PQ - How many Scores of 80 or more have been obtained by Subject - with Pivot Table

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

    Cool PQ - How many Scores of 80 or more have been obtained by Subject - with Pivot Table

    Because in the Standard Pivot Table it is not possible to use a filter of greater, less, greater or equal etc. then Power Query solves this problem

    Source Filter Result
    Name Subject Score Filter Subject Count of Score
    Jack Maths
    84
    75
    Chem
    2
    Fred Chem
    73
    English
    3
    Pete English
    89
    French
    3
    Harry French
    88
    Maths
    2
    Mary Maths
    60
    Grand Total
    10
    Sally Chem
    62
    Don English
    79
    Ken French
    91
    Eddie Maths
    70
    Sara Chem
    92
    Joel English
    75
    Tom French
    88
    Jake Maths
    94
    Noel Chem
    95

    Code:
    let
        def = Excel.CurrentWorkbook(){[Name="Table5"]}[Content][Filter]{0},
        Source = Excel.CurrentWorkbook(){[Name="Table13"]}[Content],
        Filter = Table.SelectRows(Source, if def = null then each [Score] >= 0 else each [Score] >= def)
    in
        Filter
    Filter Result
    Filter Subject Count of Score
    90
    Chem
    2
    French
    1
    Maths
    1
    Grand Total
    4
    Filter Result
    Filter Subject Count of Score
    80
    Chem
    2
    English
    1
    French
    3
    Maths
    2
    Grand Total
    8
    Filter Result
    Filter Subject Count of Score
    Chem
    4
    English
    3
    French
    3
    Maths
    4
    Grand Total
    14
    Last edited by sandy666; 10-17-2020 at 04:41 PM.
    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 sub-levels in Pivot Table
    By sandy666 in forum ETL PQ Tips and Tricks
    Replies: 0
    Last Post: 07-29-2020, 06:28 PM
  2. Use SUMIFS on pivot table data
    By malta1 in forum Excel Help
    Replies: 1
    Last Post: 02-18-2014, 10:55 AM
  3. Create a Pivot table
    By NITIN SHETTY in forum Excel Help
    Replies: 3
    Last Post: 01-26-2013, 11:01 AM
  4. Lookup and Count Using Pivot Table
    By RobExcel in forum Excel Help
    Replies: 2
    Last Post: 12-21-2012, 11:08 AM
  5. Filter more than one pivot table at one time
    By larryt1940 in forum Excel Help
    Replies: 8
    Last Post: 05-04-2012, 06:45 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
  •