Forum Discussion

Rana80's avatar
Rana80
Frequent Visitor
2 years ago
Solved

Create table from another table as a single row for top N records

Hi,

I have been usuing PBI for a few months but i'm stuck on this one query.

 

I'm trying to create another version of a table called 'Chat' but i only want the first 2 records of each Task id as a single row from the below data.

The logic of the first 2 rows should be the earliest Create By time which i have labeled in DAX as step 1, step 2 etc. It is basically the first '2 steps' i need as a single row in a new table so i can do some time analysis from the created by dates of each task id.

 

I really need the new table to look like the below.

 

 

Could anyone help. Thank you in advance for your support!.

 

 

 

  • You can recreate the 'step' column in Power Query.

3 Replies

  • CoreyP's avatar
    CoreyP
    Icon for Solution Sage rankSolution Sage

    What you could do is duplicate your table in Power Query. On your first table, filter on Step to only return 1's. Then filter your second table on Step to only return 2's. Then merge the two queries on Chat Number. 

    • Rana80's avatar
      Rana80
      Frequent Visitor

      Hi, thanks for your response. Unfortunately that method will not work via Power Query because the 'Step' part that orders the chat in a sequential order is a DAX calculated column which doesnt seem to show up in Power Query. Is there another way?

      • CoreyP's avatar
        CoreyP
        Icon for Solution Sage rankSolution Sage

        You can recreate the 'step' column in Power Query.