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
vutruong
Helper I
Helper I

[Urgent] Calculate Weighted Average from different tables

Hi team,

 

I have a difficulty to solve related to building a pie chart which comes from the calculation of % weighted average of 4 products. Details as belows:

- I have total 2,898 outlets and 4 products A, B, C, D which come from 4 different product tables . Only product A are sold in all 2,898 outlets, other products are sold in some outlets. It also mean some outlets sell all 4 products, some only sell 3 or even 2.

- The column "Product A Actual % Sales per outlet" means the percentage of sales performance in one outlet, min =0% and max = 100%

- I need to create a pie chart to compare the sales percentage of 4 products to know which have more contribution to the total sales. And because those 2,898 outlets allocated into different regions (I do have region column but dont show it here) so I need to create a calculation that will works when filtering any region.

 

However, I dont know how to do it with weighted average formula. The true fomula should be presented the same result as:

Pie chart:

Percentage of product A: 68%*2,898/(68%*2,898 + 70%*2,717 + 57.42%*1,525 + 73.6%*1,817) = 32.4%

Similarly for Product B, C, D.

 

Thank you for your help

Regards,

Vu

 

 

ABC.png

 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @vutruong,

 

Maybe you can write a mesure with merged table(four tables) as variable to calculate with current records.
BTW, it will be help if you share some sample data for analysis.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
vutruong
Helper I
Helper I

 

Hi@v-jiascu-msft, can you please look through and give me your advice on? Thank you.

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.