+ Reply to Thread
Results 1 to 3 of 3

Is there a way to create an "If Then" Group By in Power Query using parameter values?

  1. #1
    Registered User
    Join Date
    01-01-2020
    Location
    Texas
    MS-Off Ver
    Office 365
    Posts
    3

    Is there a way to create an "If Then" Group By in Power Query using parameter values?

    I am trying to create a Power Query which will sum up certain rows of data based on a condition set by a parameter that is passed to query. Here is the source data:

    Profits Sales Sales Region

    1 333 North
    23 4 West
    4 33 East
    5 5 West
    5 5 North
    3 325 East
    2 833 East

    If the parameter is set to sum by sales region, Id like the results to look like this:

    Sales Region Profits Sales
    North 6 338
    West 28 9
    East 9 1191

    If parameter is not set to sum by sales region, the results would look like this:

    Profits Sales Sales Region

    1 333 North
    23 4 West
    4 33 East
    5 5 West
    5 5 North
    3 325 East
    2 833 East

    Basically, and If "yes" then group certain rows of data, if no, do nothing.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    18,545

    Re: Is there a way to create an "If Then" Group By in Power Query using parameter values?

    crossposted: https://www.mrexcel.com/board/thread.../#post-5396520

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    18,545

    Re: Is there a way to create an "If Then" Group By in Power Query using parameter values?

    Have you read this? https://www.excelguru.ca/blog/2018/0...n-power-query/

+ 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. [SOLVED] Power Pivot Data Model Extra "Query" tabs
    By trisoldee in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-17-2019, 11:37 AM
  2. A survey to see who is using Excel " Power Query "..
    By Potholes in forum The Water Cooler
    Replies: 6
    Last Post: 06-19-2019, 11:51 PM
  3. Replies: 0
    Last Post: 12-10-2014, 09:16 PM
  4. Microsoft Query parameter - "is one of"
    By Marcus Langell in forum Excel General
    Replies: 6
    Last Post: 09-30-2014, 06:08 PM
  5. Pass "select all" parameter to ODBC query
    By ColoradoJay in forum Excel General
    Replies: 0
    Last Post: 04-22-2012, 05:57 PM
  6. How to write parameter query with "or is null" criteria
    By Vincent Alliance in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 04-07-2006, 10:00 PM
  7. Criteria using "Or" and parameter query
    By Troy Man in forum Excel General
    Replies: 2
    Last Post: 02-28-2006, 02:00 AM

Tags for this Thread

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