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
Anonymous
Not applicable

Calculating percentage from two different tables in power bi desktop

Hi - I'm an experienced Excel VBA user but new to Power BI.

I have daily sales data from a single outlet/branch in one table and the monthly national sales for the whole company in another table.

 

eg: 

 

TABLE 1

BRANCH A SALES

2nd Jan 2019     50 sold

5th Jan 2019     46 sold

10th Jan 2019   4 sold

TABLE 2
COMPANY TOTAL SALES
January 2019     1000 sold

 

 

The tables both go into February, March, etc.... and will continue into 2020, 2021 etc.

I want to create a column in either of the tables to show the percentage of the BRANCH sales, compared to the companies total sales.... so, for January, as the company sold 1000 of the product, and Branch A sold 100 of the product, somewhere there should be "JANUARY: 10%"

How could I achieve this with DAX or Power Query M please?

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Sorry to reply you late. Based on my test, you could refer to below stpes:

Sample data:

1.PNG3.PNG

Use below calculated column:

Percentae = CALCULATE(SUM(Table1[Sales]),FILTER('Table1',MONTH('Table2'[Company])=MONTH('Table1'[Branch])))/[Sales]

Now you could see the result:

2.PNG

You could aslo download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
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

5 REPLIES 5
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous ,

I could not clear with your desired result about:

I want to create a column in either of the tables to show the percentage of the BRANCH sales

Could you please post your desired result if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-danhe-msft - Did my extra description help describe the outcome which I'm hoping for? 

 

Anonymous
Not applicable

@v-danhe-msft - Did my extra description help describe the outcome which I'm hoping for? 

Hi @Anonymous ,

Sorry to reply you late. Based on my test, you could refer to below stpes:

Sample data:

1.PNG3.PNG

Use below calculated column:

Percentae = CALCULATE(SUM(Table1[Sales]),FILTER('Table1',MONTH('Table2'[Company])=MONTH('Table1'[Branch])))/[Sales]

Now you could see the result:

2.PNG

You could aslo download the pbix file to have a view.

 

Regards,

Daniel He

 

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-danhe-msft Daniel - ultimately, I'd be looking to create a vertical bar graph with January, February, March etc along the bottom, with bars showing the percentage of The Branches sales each month, compared to the whole companies sales for each month.

 

eg:  In January, the branches sales accounted for 10% of the companies sales, in February, the branches sales were 12% of the companies sales ...and so on. 

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