cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
nicolasvc
Helper II
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
1A1000
1B500
2A300
2B200

 

index year month week
1202111
2202125
3202139

 

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
1A1000202111
1B500202111
2A300202111
2B200202111

 

1 ACCEPTED SOLUTION
VahidDM
Community Champion
Community Champion

Hi @nicolasvc 

 

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])
 
VahidDM_0-1634847360278.png

 

 
 

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

Appreciate your Kudos!!


 

View solution in original post

1 REPLY 1
VahidDM
Community Champion
Community Champion

Hi @nicolasvc 

 

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])
 
VahidDM_0-1634847360278.png

 

 
 

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

Appreciate your Kudos!!


 

View solution in original post

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

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

Jan 2022 Dev Camp 768x460 copy.png

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