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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
nicolasvc
Helper III
Helper III

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
Super User
Super User

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
Super User
Super User

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!!


 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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