Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Collecting data from multiple lines to one line

Hi colleagues,

 

I would like to have your support about the topic below:

I have one table (summarized table) including multiple lines for each "Company" with different audit status.

Is it possible to combine all these line, and resume the audit status in one line for each supplier ?

Target is to move from Table 1 to Table 2:

 

CompanyAudit 1Audit 2Audit 3Audit 4
Xvalid   
X planned  
X    
X   expired
Y   expired
Yplanned   
Y planned  
  valid 
Z   expired
Z  planned 
Z valid  
Zvalid   

Thanks for your support !

Best regards.

  • You could use SUMMARIZE or GROUPBY on your table.

     

    For example:

    SUMMARIZE (
        Table1,
        Table1[Company],
        "Audit 1", MAX ( Table1[Audit 1] ),
        "Audit 2", MAX ( Table1[Audit 2] ),
        "Audit 3", MAX ( Table1[Audit 3] ),
        "Audit 4", MAX ( Table1[Audit 4] )
    )

     

5 Replies

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    I have done tests and think the solution provided by AlexisOlson  works, refer to the following.

    If the problem is still not resolved, please point it out. Looking forward to your reply.


    Best Regards,
    Henry

     

    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

      amitchandak First, thanks for your reply. 

      As my table is a result of "summarize" function, I can't use the "group by" ==> when i open power query my table isn't there.

      Is there any other solution please ?

      • AlexisOlson's avatar
        AlexisOlson
        Icon for Super User rankSuper User

        You could use SUMMARIZE or GROUPBY on your table.

         

        For example:

        SUMMARIZE (
            Table1,
            Table1[Company],
            "Audit 1", MAX ( Table1[Audit 1] ),
            "Audit 2", MAX ( Table1[Audit 2] ),
            "Audit 3", MAX ( Table1[Audit 3] ),
            "Audit 4", MAX ( Table1[Audit 4] )
        )