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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nsethia
New Member

Calculating rows in Power Bi

Hi all,

 

I've separate spreadsheets for each store with data similar to

 

Store A                    Store B

Product   Sales         Product    Sales

Shoes     100            Shoes      150

Shirts       50            Shirts         70      

 

I need to add up total sales in a new column like 

 

Store A                    Store B

Product   Sales         Product    Sales      Total Sales

Shoes     100            Shoes      150                250

Shirts       50            Shirts         70                120

 

Is there a way to do that in Powerbi desktop?

 

Thanks

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@nsethia

 

In this scenario, as you already separate tables for each store into different worksheet, you can generate one dataset for each worksheet. Since each dataset has same structure, you can use "merge queries" to combine two tables together. Just rename columns into "Sales for Store A" and "Sales for Store B".

 

4.PNG

 

Then you can easily create a calculated column to calculate the total.

 

Regards,

 

 

Phil_Seamark
Microsoft Employee
Microsoft Employee

I take it you have more than 2 stores.  

 

I recommend you append the tables to each other.  This can be done in the Query Editor using the APPEND function in the ribbon, or you can do this in DAX using the UNION fuction.

 

You are after a single table that looks like this

Store    Product Sales
------   ------- ,-------
Store A, Shoes , 100
Store A, Shirts ,50
Store B, Shoes , 150
Store B, Shirts,   70

Once you have your data in this format, you can use the various grid visuals (matrix) to show the data.

 

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors