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
sneha_rudra
Frequent Visitor

Calculate percentage of each store as per total sales

Hi,

I have the following tables:

1) Dispatch data: It has Store name, sales, orders

  and I created a measure Total sales = sum(Sales)

2)Stores data: It has Store name and other information about stores

The 2 tables are joined by Store name column.

Now, I want to show the percentage of sale amount of each store , how can I calculate it?

 

For e.g.,

Store name     Total Sale      %of sales

Store 1            1000                 25%   

Store2             3000                 75%

So, I want the "%of slaes" column to be calculated. I am new to Power BI, please help! Thanks in advance..

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @sneha_rudra 

 

According to your description, I think you can create a measure just like this:

Measure = var total=SUM(Table1[Sales])
var totalall=SUMX(ALL(Table1),[Sales])
return DIVIDE(total,totalall)

vjaneygmsft_0-1649644708415.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

3 REPLIES 3
Najibe
Regular Visitor

I have two tables in Power BI:
The first table of sales invoices has the sales invoice code and the total amount of each sales invoice, and the second table has the product code and the sales price of each product separately. I want to get the percentage share of each product separately from the total sales amount. A sales invoice may contain one or more products.
Thank


Table 1

sales invoice codetotal amount
100200
1034500

 

Table 2 

product codesales price
1100
2100
34500

 

sneha_rudra
Frequent Visitor

Hi v-janeyg-msft,

 

Thank you so much, it's working perfectly fine. I just took the column total of the measure. 🙂

v-janeyg-msft
Community Support
Community Support

Hi, @sneha_rudra 

 

According to your description, I think you can create a measure just like this:

Measure = var total=SUM(Table1[Sales])
var totalall=SUMX(ALL(Table1),[Sales])
return DIVIDE(total,totalall)

vjaneygmsft_0-1649644708415.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

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.