Forum Discussion
Create table from existing data set in power query excel
I have a large dataset that is in power query from multiple excel spreadsheets. I want to create a new smaller table which would include only two columns from the large data set. one column is Name and the other column is a Wage % measure. The wage % measure should be the product of the rows (meaning if there were 3 rows in the large data set, I would get one row in small dataset but the wage % would multiple each row to arrive at the new one line answer).
Is this possible in power query, I know how to do it in Power bi, but I cannot do it in excel power query.
Hello 10500438
Select every column except the last one --> Tranform --> Group by
Set the group by like this
change the formula in the formula bar the part of the funciton like this
each List.Product([Unit Yield])
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
6 Replies
- Jimmy801Community Champion
Hello 10500438
there should be no difference for Power Query Excel or Power BI when it comes to basic functions.
Check out this solution. It applies a Table.Group with a List.Product-function
let Source = #table ( {"Name","Wage%"}, { {"A","0,05"}, {"A","0,04"}, {"A","0,1"}, {"B","0,3"}, {"B","0,5"}, {"B","0,3"}, {"C","0,2"}, {"C","0,1"} } ), ChangeType = Table.TransformColumnTypes(Source,{{"Wage%", Percentage.Type}}), Group = Table.Group ( ChangeType, {"Name"}, {{"Product", each List.Product([#"Wage%"]) , Percentage.Type}}) in GroupCopy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy- 10500438Helper II
I feel like we are on the right track, but I cannot figure out how to implement this into my solution. I have only been using Power BI and Power Query for a short while. How can I upload my excel file for you to see what I am working with?
In the meantime here is my output from my query,
what I am trying to do is have the same output as below, but any Unique Key that has more than one line item, The Unit Yield column should be mulitplied times each other and have one single row that represents the result.
The data set is very large because of the mulitple times products move through a mill area, so to get a smaller set, I can multiply mill areas times each other to get the correct result per mill area. Thanks in advance for all your help.
- Jimmy801Community Champion
Hello 10500438
Select every column except the last one --> Tranform --> Group by
Set the group by like this
change the formula in the formula bar the part of the funciton like this
each List.Product([Unit Yield])
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
- Greg_DecklerCommunity Champion
Yes, right click your query and choose Reference.
- v-juanli-msftCommunity Support
Hi 10500438
Is this problem sloved?If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?If not, please feel free to let me know.Best RegardsMaggie