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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
filiparibeiro
Helper III
Helper III

Obtain row value based on index number in another column

Hello.


I'd like to add a custom column in power query that allows me to obtain the corresponding value in column 1 based on a certain Index value, ie., I'd like to obtain for index=12 the letter M for all rows in the new custom column. How do I do this?

 

filiparibeiro_0-1666187457997.png

Thanks in advance. 

3 REPLIES 3
filiparibeiro
Helper III
Helper III

@Greg_Deckler But in the new custom column I want to obtain only the value in column 1 corresponding to index number = 12 ,ie,  a column where all the rows equal "M"...

Anonymous
Not applicable

Hi @filiparibeiro ,

 

Like this?

vcgaomsft_0-1666248633225.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("HcTHEYMwAACwXfxmCWoooYROfN5/De6kh2IMeUhZDIVLV67d+OPWnXsP/nr05NmLf169effh05dvP/6HlF4=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 0, 1, Int64.Type),
    #"Step Name" = Table.SelectRows(#"Added Index", each [Index] = 12)[Column1]
in
    #"Step Name"

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Greg_Deckler
Community Champion
Community Champion

@filiparibeiro Use a Merge step?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.