Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Append columns from the same datasource

HI I have a datasheet with ID's, description and date as columns and I need to append them so its all ine one place.

 

Datastructure Current:

 

9/17/200                             9/24/200                                 10/04/2020

ID              Description        ID                  Description        ID                Description   

AD1           Text 1                 AD5           Text 5                    AD3          Text 3   

AF1           Text 5                AM5           Text 12                    AN7         Text 9   

 

I want it to be in the following format:

 

Date               ID            Description

9/17/2020      AD1         Text1

9/17/2020      AF1           Text 5 

9/24/200        AD5           Text 5

9/24/200       AM5           Text 12 

10/04/2020   AD3          Text 3

10/04/2020 AN7         Text 9 

 

If someone has an idea how to implement this , help will be greatly appreciated.

 

 

Thanks

  • Hi Anonymous ,

     

    Go to query editor >transform>"Use header as first row":

    And you will see:

    Then using "transposed Table">"Filled down">"Unpivot column 3 and column 4",you will see:

    Adding an index column then back to data view;

    Create a Rank column as below:

    Rank = RANKX(FILTER('Table','Table'[Column2]=EARLIER('Table'[Column2])),'Table'[Index],,ASC,Dense)

    Finally in a matrix, you will see:

    For the related .pbix file,pls see attached.

     

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

5 Replies

  • v-kelly-msft's avatar
    v-kelly-msft
    Community Support

    Hi Anonymous ,

     

    Go to query editor >transform>"Use header as first row":

    And you will see:

    Then using "transposed Table">"Filled down">"Unpivot column 3 and column 4",you will see:

    Adding an index column then back to data view;

    Create a Rank column as below:

    Rank = RANKX(FILTER('Table','Table'[Column2]=EARLIER('Table'[Column2])),'Table'[Index],,ASC,Dense)

    Finally in a matrix, you will see:

    For the related .pbix file,pls see attached.

     

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your reply Kelly. However if there was a scenerio where the column headers from the source has a combination of text and dates then how would we handle that, for example , if the data looks something like below:

      Late Items That need to be caught upDesc9/27/2020                     items = 6Desc10/4/2020                     items = 14Desc10/11/2020                  items = 0Desc10/18/2020                   items = 18Desc10/25/2020                 items = 1 Desc11/1/2020                 items = 16Desc
      Item 1gdkgkdItem 3gethetItem 5dfgbdItem 7vgdItem 9gthItem 11kyuItem 13i6jt
      Item 2vsfvfsvItem 4asfdsfsItem 6mjggItem 8edwItem 10jtyujItem 12fwefItem 14sfef
    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes I tried but the issue is all columns of description has different column names , so it spits out into different columns and it doe snot work as expected.