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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
BobbyTheBuilder
Frequent Visitor

Link Column Names Wwith Another Table Rows

Hi,

 

I'm trying to do subtotals of specific column based on if their names are grouped together as stated in another table.

 

This would be the table where there would be subtotals (the ??).

 

NameTomatoesOnionsMushroomsBeefRamenPorkCilantroSpaghettiRamen
Sabrina            57  $            26  $            98  $            13  $            95  $              4  $            57  $ ??  ?? 
Johnny            49  $            52  $              5  $            32  $            36  $            93  $            30  $ ??  ?? 
Philip            52  $            48  $            58  $            87  $            19  $            90  $            89  $ ??  ?? 
Nancy            46  $            56  $            25  $            44  $            92  $            56  $            69  $ ??  ?? 

 

This would be the table where the column names are grouped:

 

CategoryRecipe
TomatoesSpaghetti
OnionsSpaghetti
MushroomsSpaghetti
BeefSpaghetti
RamenRamen
PorkRamen
CilantroRamen

 

Thanks!

1 ACCEPTED SOLUTION

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

View solution in original post

17 REPLIES 17
BobbyTheBuilder
Frequent Visitor

My two tables are the two above. One table has the list of the people, and the other table has the categories. What I want to do is really to sum up the people spending based on if the columns titles are fit in the category.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirements, share the expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Pleasecheck my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you don't meet your requirements, share your expected result.

Best regards
Community Support Team _ Eason
If this post helps, consider Accepting it as the solution to help other members find it faster.

Hello, @BobbyTheBuilder

I suggest you create a new table in the advanced editor by following these steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Please check my attached pbix for more details)

The result will be shown below:

56.png

58.png

If there are not many categories, you can also try measures as shown below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

If you do not meet your requirement, share your expected result.

Best regards
Community Support Team _ Eason
If this post helps,then consider Accepting it as the solution to help other members find it faster.

Hi, @BobbyTheBuilder 

I would suggest you to create a new table in the advanced editor, as follow steps:

Duplicate a new table->pivot table->merge table->group by->merge table. (Please check my attached pbix for more details)

The result  will show as below:

56.png

58.png

If there are not many categories , you can also try measures  as below:

Measure_Ramen = SUM('Table'[Ramen])+SUM('Table'[Pork])+SUM('Table'[Cilantro])
Measure_Spaghetti = sum('Table'[Tomatoes])+Sum('Table'[Onions])+sum('Table'[Mushrooms])+sum('Table'[Beef])

 

If it doesn't meet your requirement ,please share your expected result.

 

Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

emilymgoitia
Helper I
Helper I

Hey there.  What does your data look like?  Is it more like the first example or the second?  If the second, you can do a nested if statement that is something like if(containsstring,category,"ramen", "ramen", if(containsstring,category,"pork", "ramen", if(containsstring,category,"cilantro", "ramen", "Spaghetti") and then you can subtotal your recipes.  Let me know if you need more help with this.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.