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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Joe_100
Helper I
Helper I

Power Query / M create new column, with value from specific row and field

Hi all,

 

I am trying to import some data from a csv file into PowerBi.

I need a specific value from a row and column, let's say first row/column5.

 

Then i need to create a new column and need to have the selected value in the previous step in the new column in each row.

 

How am i going to accomplishthat in Power Query (Not DAX).

 

Thanks!

1 ACCEPTED SOLUTION

Hi, @Joe_100 

 

#"Added Custom" receive the a table returned by the last step. [Column5]{0} means first row/column5. Here is my test.

Table:

a1.png

 

You may create a Custom Column as follows.

a2.png

a3.png

 

#"Changed Type" is the last step which returns a table result. [Score]{0} is the value of the first row/Score.

 

Best Regards

Allan

 

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

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @Joe_100 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

Razwan
Helper I
Helper I

@Joe_100 
Hi, could you provide an example of your desired output?

@Razwan 

Got it solved by now 🙂

 

Not familiar with the Power Query/ M language, so i dont totally understand how it behaves.

 

I added a custom column and first used the following formula:

 [Column5]{0}

 

That didn't worked.

 

This works, mentioning the previous step (not sure why though?):

#"Added Custom" [Column5]{0}

Hi, @Joe_100 

 

#"Added Custom" receive the a table returned by the last step. [Column5]{0} means first row/column5. Here is my test.

Table:

a1.png

 

You may create a Custom Column as follows.

a2.png

a3.png

 

#"Changed Type" is the last step which returns a table result. [Score]{0} is the value of the first row/Score.

 

Best Regards

Allan

 

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

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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