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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
drthybl
Regular Visitor

Summary table from other tables

I've been working for hours to get a summary table that will look like this:

 

SummaryTable1

Name

 

Inventory

Available
Apple102
Banana102
Mango201

 

Name and Inventory column is hard coded. The values in Avalable column are from another table like this

 

Rawtable1

PersonAppleBananaMango
MaryUser  
PaulUserUser 
Ben  User
Nel User 

 

What should I formulate on the SummaryTable1 to get a summary view? 

1 ACCEPTED SOLUTION

@drthybl: You mentioned that your raw data table looked different than the raw data in the solution Ashish provided. However his solution starts with the same raw data that you provided.


You can see this by going into the Power Query Editor, via Transform Data on the Home section of the ribbon. Then in Power Query, if you click Table 2 in the Queries pane on the left, and then click Source in the Applied Steps pane on the right, you will see that the data is in your original format.

Ashish then used the Unpivot Other Columns step to transform your raw data into the correct format needed to create a relationship to the other table.

 

SteveHailey_0-1641062277392.png

Note that the Unpivot Other Columns step will still work with your non-simplified data that has many other columns.

Here's some more info on Unpivoting data: Unpivot columns (Power Query) (microsoft.com)

And a free course on Power Query Fundamentals: Power Query Fundamentals - Skillwave Training

 

He then created a relationship between the two tables, joining them on the name of the fruit. 

More info: Create and manage relationships in Power BI Desktop - Power BI | Microsoft Docs

 

And then created two measures. One is just a sum, but the other, the "Available" measure, uses CALCULATE and DISTINCTCOUNT. 

More info: CALCULATE – DAX Guide  DISTINCTCOUNT - DAX Guide

 

It's a good solution and I think it would do you well to dive into it and understand it.

 

-Steve

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

However, my raw table looked like the raw table I have displayed above. please take note that my original raw table contains too many columns i just simplified it for better view 🙂

Hi,

@SteveHailey has answered your question.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@drthybl: You mentioned that your raw data table looked different than the raw data in the solution Ashish provided. However his solution starts with the same raw data that you provided.


You can see this by going into the Power Query Editor, via Transform Data on the Home section of the ribbon. Then in Power Query, if you click Table 2 in the Queries pane on the left, and then click Source in the Applied Steps pane on the right, you will see that the data is in your original format.

Ashish then used the Unpivot Other Columns step to transform your raw data into the correct format needed to create a relationship to the other table.

 

SteveHailey_0-1641062277392.png

Note that the Unpivot Other Columns step will still work with your non-simplified data that has many other columns.

Here's some more info on Unpivoting data: Unpivot columns (Power Query) (microsoft.com)

And a free course on Power Query Fundamentals: Power Query Fundamentals - Skillwave Training

 

He then created a relationship between the two tables, joining them on the name of the fruit. 

More info: Create and manage relationships in Power BI Desktop - Power BI | Microsoft Docs

 

And then created two measures. One is just a sum, but the other, the "Available" measure, uses CALCULATE and DISTINCTCOUNT. 

More info: CALCULATE – DAX Guide  DISTINCTCOUNT - DAX Guide

 

It's a good solution and I think it would do you well to dive into it and understand it.

 

-Steve

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.