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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. 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 Supplier
Solution Supplier

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

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.