Forum

Power Query - Condi...
 
Notifications
Clear all

Power Query - Conditional Column

5 Posts
2 Users
0 Reactions
152 Views
(@braga_felipe)
Posts: 3
Active Member
Topic starter
 

Hello everyone, i think i have a simple problem but i don't know how to do this. For example, i want to add a column Model_Without_duplicates and Section_Sum like in the image below. How can i do this in power query?

Model Section Model_Without_duplicates Section_Sum
M100 25 M100 80
M100 25 M101 65
M100 30 M102 100
M101 30    
M101 35    
M102 50    
M102 50    
 
Posted : 03/05/2022 9:21 am
Riny van Eekelen
(@riny)
Posts: 1186
Member Moderator
 

Not sure if this a very useful operation but taking your request literally, perhaps the attached file can help you on your way.

Screenshot-2022-05-02-161541.png

 
Posted : 03/05/2022 10:16 am
(@braga_felipe)
Posts: 3
Active Member
Topic starter
 

I understand what you did in excel. But i'm trying to do this in power query in power bi to automate this process in a table with 20000+ parameters. I've read this topic: https://www.myonlinetraininghub.com/excel-forum/power-query/power-query-conditional-sum-column and my doubt is about to integrate my ideia to this code or something simmilar.

Do you think im in a wrong way to do this? If yes, could you suggest another topic to read? 

I'm not a expert in power bi, but i'm trying to learn. 

Best regards.

 
Posted : 03/05/2022 10:30 am
Riny van Eekelen
(@riny)
Posts: 1186
Member Moderator
 

But the green table in the file I uploaded was made in PQ

 
Posted : 03/05/2022 10:51 am
(@braga_felipe)
Posts: 3
Active Member
Topic starter
 

Oh thank you so much, i will try it! 

Best regards!

 
Posted : 03/05/2022 11:54 am
Share: