cancel
Showing results for
Search instead for
Did you mean:
Helper II

## select a row by index and copy in a table

I have 2 tables, the first table with the value of a product per store, and in the second the number of the first week of the year x month, and also the index.

 Store Product Value 1 A 1000 1 B 500 2 A 300 2 B 200

 index year month week 1 2021 1 1 2 2021 2 5 3 2021 3 9

And I need to add these three columns to the first table, but only the one with index 1 as shown. How can I select a row by index?

 Store Product Value year month week 1 A 1000 2021 1 1 1 B 500 2021 1 1 2 A 300 2021 1 1 2 B 200 2021 1 1

1 ACCEPTED SOLUTION
Community Champion

Try to add 3 new columns with below codes:

Year = maxx(filter('Table (2)','Table (2)'[index]=1),'Table (2)'[ year])
Month = maxx(filter('Table (2)','Table (2)'[index]=1),'Table (2)'[ month])
Week = maxx(filter('Table (2)','Table (2)'[index]=1),'Table (2)'[ week])

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

Appreciate your Kudos!!

1 REPLY 1
Community Champion

Try to add 3 new columns with below codes:

Year = maxx(filter('Table (2)','Table (2)'[index]=1),'Table (2)'[ year])
Month = maxx(filter('Table (2)','Table (2)'[index]=1),'Table (2)'[ month])
Week = maxx(filter('Table (2)','Table (2)'[index]=1),'Table (2)'[ week])

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

Appreciate your Kudos!!

## Helpful resources

Announcements

#### Check it Out!

Click here to read more about the December 2021 Updates!

#### Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

#### Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors