+ Reply to Thread
Results 1 to 6 of 6

2 fields checker- Request for alternative option in Power Query or Power Pivot

  1. #1
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    2 fields checker- Request for alternative option in Power Query or Power Pivot

    Hi Experts & Gurus,

    I have a list with some agent names and HGH codes along with the revenue.
    GDS has around 20 unique codes, I would like to get the revenue of agents who is only handling 2 particulars HGH codes (1S and 1B).
    I have used some basic formulas and got the result in my test file. But the real data is huge and it takes a lot of time to run the sheet.
    Could you please help me to solve this using power query or power pivot tools?
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: 2 fields checker- Request for alternative option in Power Query or Power Pivot

    Please try formula at
    G8
    =SORT(FILTER(UNIQUE(A2:A28),MMULT(COUNTIFS(A2:A28,UNIQUE(A2:A28),B2:B28,{"1B","1S"}),{1;1})=COUNTIFS(A2:A28,UNIQUE(A2:A28))))
    H8
    =MMULT(SUMIFS($C$2:$C$28,A2:A28,G8#,B2:B28,{"1B","1S"}),{1;1})

    or single-cell formula with let
    =LET(Agent,A2:A28,High,B2:B28,u,UNIQUE(Agent),c,{"1B","1S"},Ua,SORT(FILTER(u,MMULT(COUNTIFS(Agent,u,High,c),{1;1})=COUNTIFS(Agent,u))),
    CHOOSE({1,2},Ua,MMULT(SUMIFS(C2:C28,Agent,Ua,High,c),{1;1})))

    Power Query
    Please Login or Register  to view this content.
    DAX measure
    =if(CALCULATE( Sum(Table1[Revenue]), Table1[HGH]<>"1B",Table1[HGH]<>"1S")=0,
    CALCULATE( Sum(Table1[Revenue]), Table1[HGH] in { "1B","1S"}))
    Attached Files Attached Files

  3. #3
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: 2 fields checker- Request for alternative option in Power Query or Power Pivot

    Thanks a ton.
    Last edited by AliGW; 11-15-2020 at 08:38 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: 2 fields checker- Request for alternative option in Power Query or Power Pivot

    Can you please explain me how the grouping done in Power Query?

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: 2 fields checker- Request for alternative option in Power Query or Power Pivot

    Please see step by step on this Query

    Please Login or Register  to view this content.
    SbS.png
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: 2 fields checker- Request for alternative option in Power Query or Power Pivot

    Thank you.
    That means, we should have knowledge on M Language, right?

+ 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. Power Query / Power pivot : M2M relationships problem
    By almourasel in forum Excel General
    Replies: 6
    Last Post: 03-26-2020, 05:33 PM
  2. [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
  3. POWER Query and Power Pivot Table !!
    By haitham.shop in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-06-2018, 04:09 PM
  4. Power Query and Power Pivot Table
    By haitham.shop in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-06-2018, 06:17 AM
  5. Power Query and Power Pivot Table !!
    By haitham.shop in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-06-2018, 06:15 AM
  6. 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
  7. error in power query & power pivot
    By Baldev Kumar in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 01-03-2018, 01:34 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