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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mukhan311
Frequent Visitor

Combining project date and product to correspond to the company

mukhan311_0-1708464654698.png

I have the dataset as above and want to row wise arrange the date, project, amount and product with respect to each company.
I tried pivting and unpivot but wasn't able to arrive at the conclusion.

 

Any help with this will be appreciated.

 

Thank you.

4 REPLIES 4
mukhan311
Frequent Visitor

Hi all,
Thank you for the input and please find below the sample data below along with the expected output. 

Raw sample data:

Company name Amount TotalProjectdateProduct Project2productdateamount project3productamount3date
Honda 160001000111-Jan-23headlamp10004rework11-Feb-23120010007taillamp120017-Feb-23
Yamaha170001000212-Janheadlamp10005repair12-Feb-23125010008fender140019-Feb-23
Ducati180001000313-Jan-23headlamp10006conversion13-Feb-23130010009suspension150013-Mar-23

 

Expected output:

company nameamount ProjectdateProduct
Honda 160001000111-Jan-23 
 12001000411-Feb-23rework
 12001000717-Feb-23taillamp

You cannot have multiple columns with the same name. You are missing the amount column for the first group.

You will also want to unpivot the data to bring it into a usable format.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dY7dCoIwFIBfJXatoM7f+4gIeoAQL066cKSbTK3X72xjTqKuvnH2ne2ra3KWooMDCUicR1GkiYg14/ACIkwonnsG3QDjpMfJZqVIxd5SPa1+Yner75wCuQAfvrYLJzdBTW4wQg9m7BMSY/9JyJyVmYQJuLL6LmFzSuSDiY4ZJ7U/VPuA49rCwvW49AHmFfo7gG5WjmyleDE1cynsio/wXoWc13liwnmZvaPhFZQJaT4=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Company name " = _t, #"Amount Total" = _t, Project1 = _t, date1 = _t, Product1 = _t, amount1 = _t, Project2 = _t, Product2 = _t, date2 = _t, amount2 = _t, Project3 = _t, Product3 = _t, amount3 = _t, date3 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Company name ", type text}, {"Amount Total", Int64.Type}, {"Project1", Int64.Type}, {"date1", type date}, {"Product1", type text}, {"amount1", Int64.Type}, {"Project2", Int64.Type}, {"Product2", type text}, {"date2", type date}, {"amount2", Int64.Type}, {"Project3", Int64.Type}, {"Product3", type text}, {"amount3", Int64.Type}, {"date3", type date}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Company name ", "Amount Total"}, "Attribute", "Value"),
    #"Split Column by Character Transition" = Table.SplitColumn(#"Unpivoted Other Columns", "Attribute", Splitter.SplitTextByCharacterTransition((c) => not List.Contains({"0".."9"}, c), {"0".."9"}), {"Attribute.1", "Attribute.2"}),
    #"Pivoted Column" = Table.Pivot(#"Split Column by Character Transition", List.Distinct(#"Split Column by Character Transition"[Attribute.1]), "Attribute.1", "Value")
in
    #"Pivoted Column"

 

 

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

adudani
Super User
Super User

hi @mukhan311 ,

 

try grouping by date and project. use the sum of amount and sort it as needed

 

if this doesn't work, kindly provide a sample input and output masking senstitive data in the form of a table/sharable excel/ g sheet etc.

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.