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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
jhenscheid
Frequent Visitor

split/group multiple columns based on primary column

I am trying to split out the ChargeType, BasisType, Rate and BillableTotal columns in to their own column so that each LoadID is only consuming one row.

 

For example, LoadID 52315053 would be on one row and the ChargeType, BasisType and Rate columns would be on the same row. 

 

The different options I have played around with are Pivot, Group and Transpose.  I am guessing I will need to use a dax calculation, but am not sure where to start.  

 

There are several columns between the LoadID and ChargeType, but they are all duplicated (similar to the BillableTotal and Distance columns).

 

See sample table at the bottom to see what I think the final results would look like.

 

Thanks in advance.

 

 

 Original sample table

LoadIDChargeTypeBasisTypeRateBillableTotalDistance
52315053Base DetailFLAT283328.44142
52315053Accessorial DetailCPM0.32328.44142
52323027Base DetailFLAT345410.88366
52323027Accessorial DetailCPM0.18410.88366
52323030Base DetailCPM1.02463.2386
52323030Accessorial DetailCPM0.18463.2386
52324114Base DetailFLAT240240160
52324114Accessorial DetailCPM0240160

 

 

 

 

Final Sample table.

LoadIDBase TypeBasisTypeRateAccessorial  AccTypeAccRateBillableTotalDistance
52315053Base DetailFLAT283Accessorial DetailCPM0.32328.44142
52323027Base DetailFLAT345Accessorial DetailCPM0.18410.88366
52323030Base DetailCPM1.02Accessorial DetailCPM0.18463.2386
52324114Base DetailFLAT240Accessorial DetailCPM0240160
1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@jhenscheid

 

Hi, Please try this in Query Editor:

 

Steps in Query EditorSteps in Query Editor

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

@jhenscheid

 

Hi, Please try this in Query Editor:

 

Steps in Query EditorSteps in Query Editor

Regards

 

Victor

Lima - Peru




Lima - Peru

Thank you for your help.  This worked grreat.  I actually had another table with a similar layout and used the steps for that table as well.

 

thanks again!

Helpful resources

Announcements
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.