Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

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   

MarwenA_0-1635864153880.png

Thanks for your support !

Best regards.

1 ACCEPTED SOLUTION

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] )
)

 

View solution in original post

5 REPLIES 5
sanalytics
Solution Sage
Solution Sage

Hi @Anonymous 

 

You can also acheive your  output through Power Query..Attached is the screenshots and Power Bi file..

sanalytics_0-1636110564495.png

 

https://dropfiles.org/p7Cp8b


have a look

 

Regards

sanalytics

v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

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

vhenrykmstf_0-1636099194929.png

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.

amitchandak
Super User
Super User

@Anonymous , in power query, create a table using  group by and use min/max for all columns other than company

https://docs.microsoft.com/en-us/power-query/group-by

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
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 ?

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] )
)

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.