cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
agtech
New Member

PowerQuery syntax for a column in a table in a cell

Hi,

Wonder if anyone knows what is the syntax for referring to a List in a Table in a cell of a PowerQuery table.

I just want to find the maximum value of the 'Net Sales' coulmn of the tables that are the cells of the "Count" column. I thought it would be [Count][Net Sales] as TableColumn works in other instances but not in this instance.

 

Capture.PNG

 

1 ACCEPTED SOLUTION
Eyelyn9
Community Support
Community Support

Hi @agtech ,

 

I have created a data sample:

Eyelyn9_0-1642146987355.png

 

According to my understanding, you want to get the max score *100 of each group, right?

Please try:

=List.Max(
      List.Transform(Table.SelectRows(#"Changed Type", (q) => q[Type] = [Type])[Net Sales] ,each _))*100

Output:

Eyelyn9_1-1642147071175.png

 

Best Regards,
Eyelyn Qin
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

2 REPLIES 2
Eyelyn9
Community Support
Community Support

Hi @agtech ,

 

I have created a data sample:

Eyelyn9_0-1642146987355.png

 

According to my understanding, you want to get the max score *100 of each group, right?

Please try:

=List.Max(
      List.Transform(Table.SelectRows(#"Changed Type", (q) => q[Type] = [Type])[Net Sales] ,each _))*100

Output:

Eyelyn9_1-1642147071175.png

 

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

Vera_33
Super User
Super User

Hi @agtech 

 

You need to add the Column Score into the table (let's call it inside table) in Column Count (let's call it Outside Table ), right? Yes, it is  [Count][Net Sales] , but when you are adding a column in the inside table, there is no Count column as it is in the outside table...so modify your code like this

= Table.AddColumn(#"Grouped Rows", "Store Score", (ot) => Table.AddColumn(ot[Count],"Score", each 
Number.Round([Net Sales] / List.Max( ot[Count][Value]),2)*100))

 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!