Forum Discussion

jhenscheid's avatar
jhenscheid
Frequent Visitor
9 years ago
Solved

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

2 Replies

  • Vvelarde's avatar
    Vvelarde
    Community Champion

    jhenscheid

     

    Hi, Please try this in Query Editor:

     

    Steps in Query Editor

    Regards

     

    Victor

    Lima - Peru

    • jhenscheid's avatar
      jhenscheid
      Frequent Visitor

      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!