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
Syndicate_Admin
Administrator
Administrator

Help for calculating weighted sales

Hello:

I am new to Power BI, I have an example of sales by country and when calculating sales the result is correct.

I also have a group of sellers 1 per country, but there is a country where there are 2 sellers in the country, in order to calculate your sale there is a field called WEIGHTING, which must multiply the sale by the WEIGHTING and is the correct result.

When doing it with DAX, I have not had the desired result, I have tried, sumx and related but they have not worked as I expect.

I forgot to comment that my model is in three tables. Someone could help me, I don't know how to approach the problem correctly.

Greetings and thanks in advance.

Nube de datosData CloudTablasStalemateComprobación y resultado deseadoVerification and desired result

4 REPLIES 4
johnt75
Super User
Super User

Try defining a measure as

Total Sales = SUMX( Ventas, Ventas[CANTIDAD] * SELECTEDVALUE( Vendedores[PODERACION), 1) )

Thank you for your answer I worked halfway the solution, when removing the dimension of WEIGHTING from the table the result looks white and without subtotals in a matrix, I imagine that this is because it needs this dimension to be able to perform the multiplication correctly and not having it can not show the result. How it can be adjusted so that it gives the correct result???

The measure I defined is using 1 as the default if no weighting is found, so I don't think that that is the problem. Can you share a screenshot ?

Hello:

Look at these data do not match when I put the formula in a contracted vs expanded matrix, following the same DAX, on the other hand when he adds to the model other data where the seller can have more than one country or more than 2 weights, he begins to put blank data. it is worth mentioning, that the data I show are from a demo and not the real ones.

Any idea of how to adjust the formula?

Thank you very much and greetingsNewnuevo error error

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.