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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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