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
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
v-eqin-msft
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
v-eqin-msft
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
Resident Rockstar
Resident Rockstar

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

Top Solution Authors
Top Kudoed Authors