cancel
Showing results for
Did you mean:
Regular Visitor

## Calculate weighted distribution in a matrix

Hi everyone,

I'm trying to calculate how many products are in each bussiness by brand and manufacturer,

I already have the denominator of the weighted distribution, which is:

CALCULATE(SUM([VolSales]);ALLSELECTED(Table[Manufacturer]);ALLSELECTED(Table[Brand]))

The result of this measure gives me the total volume sales, but I want to calculate the volume sale of each brand by manufacturer.

Any ideas?

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super Contributor

## Re: Calculate weighted distribution in a matrix

Hi @Alessandra,

Based on my test, the formula below should work in your scenario.

```Measure =
return

Here is the sample pbix file for your reference.

Regards

6 REPLIES 6
Super User

## Re: Calculate weighted distribution in a matrix

Can you supply some sample data, sample output and the entire measure formula? What is your numerator?

### I have book! Learn Power BI from Packt

Proud to be a Datanaut!

Regular Visitor

## Re: Calculate weighted distribution in a matrix

This is what I have of the numerator, but I don't know how to calculate the sales volume by business ID for each manufacturer and brand.

In this picture, the red numbers are the numerator ( what I want to calculate), and the total is the denominator that I already have.

Super Contributor

## Re: Calculate weighted distribution in a matrix

Hi @Alessandra,

Is all the data in the same table or in different tables?

Could you post your real table structures(including the relationships) with some sample/mock data which can help us reproduce the issue, so that we can better assist on it? It's even better to just share a sample pbix file which can reproduce the issue. You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading

Regards

Regular Visitor

## Re: Calculate weighted distribution in a matrix

All the data is in the same table.

I'm attaching an Excel where there is some of the data that I have in power bi and in that file there is a sample of what I'm trying to do in power bi, which is the sales for each category and value where all the businesses are present. For example, for this category and this value I want to see all the business where there are sales.

There is also a sheet named SQL where there is a query for calculting the distribution.

PS: Take as example ONLY the table from the right, the table from the left is just to see the difference of the sales per category and sale of all businesses where the category is present (what is trying to do in power bi) . The data from the table from the right was calculated manually and the steps are at the bottom.

Super Contributor

## Re: Calculate weighted distribution in a matrix

Hi @Alessandra,

Based on my test, the formula below should work in your scenario.

```Measure =
return

Here is the sample pbix file for your reference.

Regards

Regular Visitor

## Re: Calculate weighted distribution in a matrix

@v-ljerr-msft

Thank you so much ! It's just what I needed

Announcements

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 46 members 1,374 guests
Recent signins: