Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Grouping rows in table based on one column

Hello,

 

I've been trying to group rows from a table with several columns based in one field ("Concept" in this example), but I don't get how to do it. This data table is similar to mine, and it provides data from 2 different sources, maybe this can be useful.

 

ConceptPrize1Prize2
140€40€
260€40€
140€60€
260€60€

 

These prizes are very similar, because the final goal is to substract both of them, to see if there are any difference between those.

Here I show this same example, but with the desired table:

 

ConceptPrize1Prize2
140€40€
260€60€

 

It probably has a solution, but right now I can't figure it out. Thanks in advance.

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi! Thanks for the solution.

    In the end, I managed to solve it by merging both queries, to create one that is grouped by column "Concept", which was the initial problem.

5 Replies

  • Anonymous , Expected output and logic is not clear

     

    The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Okey, sorry about that. I mean, I have this real example, which I have been using.

      First source, coming from an Excel document, return this 2 rows according to this example:

       

      On the other hand, from the database source, I get these rows:

       

       

      So, when I match them through another column, they return the table shown in first picture with that 4 rows.

      I only need the 1st and 4th row, because that means that price corresponds to its associated concept.

      I don't know if this example helped more when analyzing the problem.

       

      Thanks in advance again.

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    If the two data sources you mentioned are located in two different tables, then you just need to establish the correspondence between the two tables.

    So that if you create table visual , power bi will automatically identify the relationship and match them, you just get two rows:

    Not sure if this what you want, if I misunderstand your meanings,please let me know in time.

     

    Best regards,

    Community Support Team Selina zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi! Thanks for the solution.

      In the end, I managed to solve it by merging both queries, to create one that is grouped by column "Concept", which was the initial problem.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        I'm glad that you solved your problem. 

        Please mark your answer as solution to help the other members find it more quickly~

         

        Best regards,

        Community Support Team Selina zhu

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly