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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rana80
Frequent Visitor

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.
Rana80_2-1695136510130.png

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.

 

Rana80_3-1695136779961.png

 

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

 

 

 

1 ACCEPTED SOLUTION

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

View solution in original post

3 REPLIES 3
CoreyP
Solution Sage
Solution 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
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?

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.