Forum Discussion

bilingual's avatar
bilingual
Icon for Helper V rankHelper V
5 years ago
Solved

Unpivot to ID, please help

I tried in vain, to create an index column, and then get my columns transformed to rows, i need all columns except ID to be transformed, so there is only one ID per row, can anybody help? 🙂 - file is attached.

  • Hi, bilingual 

     

    If i understand correctly, you may create measures as below. The pbix file is attached in the end.

    Travel From = 
    CONCATENATEX(
        Travelservice,
        [From],
        ",
        "
    )
    Travel To = 
    CONCATENATEX(
        Travelservice,
        [To],
        ",
        "
    )

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

4 Replies

  • Hi bilingual 

    You have multiple rows of data for soem ID's.  What do you wantto do with these rows?  if you only want 1 row per ID, what rows do you keep?

    regards

    Phil

    • bilingual's avatar
      bilingual
      Icon for Helper V rankHelper V

      Hi Phillip, i need a separate column for each unique value and Date. 

       

      The reason is that i need to to see the total travel segments per day for each ID, and it is not workable in rows, if you have a better suggestion, i am all willing to hear.

  • v-alq-msft's avatar
    v-alq-msft
    Icon for Community Support rankCommunity Support

    Hi, bilingual 

     

    If i understand correctly, you may create measures as below. The pbix file is attached in the end.

    Travel From = 
    CONCATENATEX(
        Travelservice,
        [From],
        ",
        "
    )
    Travel To = 
    CONCATENATEX(
        Travelservice,
        [To],
        ",
        "
    )

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.