SOLVED

Remov Reapeat and Transpse Data

Brass Contributor

Hello my friends

 

I want in power query to remove the repeated rows and transpose the invoices like  i showed in excel file , 

 

 

thank you fry your help

8 Replies
best response confirmed by Jalal_1988 (Brass Contributor)
Solution

@Jalal_1988 I trust you have a good reason for wanting to do this, since the data is already very well structured as it is. One would normally want to go from the 'transposed' data towards data in a tabular form. But that's your choice.

See attached.

Dear fiend is there any other easy solution for that ?

tnx

@Jalal_1988 What do you mean? You ask for a PQ solution. You get one that is very basic. What other 'easy' solution do you want?

i mean any other way for solve this problem have other solution for that
l feel you

@Jalal_1988 Can't think of an easier solution right now.

Could you pease mention ste by ste which you done on file in power query

tnx

@Jalal_1988 

1) Connect to the data range

2) Promote headers

3) Group by CODE and Name. I chose 'Sum by INVOICE' first. That creates an error as you can't sum texts. But it gives you 90% of the M-code needed.

4) Manually change the initial code for the "Grouped Rows" step into:

Riny_van_Eekelen_0-1703327398871.png

5) Add an index column to number the two rows and sort/reorder the columns as you like.

 

@Jalal_1988 

sql:

//select * from basic_group_concat limit 20;
select row_number() over () NO,CODE,NAME,group_concat(INVOCIE,'</td><td>') INVOCIE from basic_group_concat group by CODE,NAME

 

Screenshot_2023-12-24-10-28-30-381_cn.uujian.browser.jpg

1 best response

Accepted Solutions
best response confirmed by Jalal_1988 (Brass Contributor)
Solution

@Jalal_1988 I trust you have a good reason for wanting to do this, since the data is already very well structured as it is. One would normally want to go from the 'transposed' data towards data in a tabular form. But that's your choice.

See attached.

View solution in original post