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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
annecheng
New Member

How to change two column Desc and amount into multiple columns each Desc for one column

Can you help with this? I would like to change:   

 

It need group by org ID and Program ID and transfer program Fee desc and fee amount into different column for each Program Fee Desc

Org#PROG IDProgram Fee DescFee Amount
2000021Tuition Fees10000
2000211Tuition Fees9650
2000211Book Fees980
2000211Professional and Exam Fee450
2000211Uniform and Equipment1200
2000211Student services12280
2000212Tuition Fees200
2000212Book Fees600
2000212Professional and Exam Fee50
2000212Uniform and Equipment600
2000212Student services50
2000212Other40

to 

 

Org#PROG IDTuition FeesBook FeesMajor EquipmentProfessional and Exam FeeUniform and EquipmentOtherStudent services
200002110000000000
2000211965098004501200012280
20002122006000506004050
1 ACCEPTED SOLUTION
v-angzheng-msft
Community Support
Community Support

 Hi, @annecheng 

 

Follow the steps below:

Sample:

v-angzheng-msft_0-1619755931586.jpeg

Result:

v-angzheng-msft_1-1619755931588.png

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-angzheng-msft
Community Support
Community Support

 Hi, @annecheng 

 

Follow the steps below:

Sample:

v-angzheng-msft_0-1619755931586.jpeg

Result:

v-angzheng-msft_1-1619755931588.png

Is this the result you want? Hope this is useful to you

Please feel free to let me know If you have further questions

 

Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

This M code works

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Org#", Int64.Type}, {"PROG ID", Int64.Type}, {"Program Fee Desc", type text}, {"Fee Amount", Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[#"Program Fee Desc"]), "Program Fee Desc", "Fee Amount", List.Sum)
in
    #"Pivoted Column"

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
TomMartens
Super User
Super User

Hey @annecheng ,

 

you want to pivot the column "Program Fee Desc".
This article describes how you can achieve using Power Query: Pivot columns | Microsoft Docs

Hopefully, this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

I updated the question to add one more layer for grouping.  Please help.  Thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.