Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
jlarques
Helper V
Helper V

Calculate different profit depending of the percentatge

Hi Community,

 

I have a problem with sellers' percentages. Depending on the customer, sales have to be distributed between two sellers. I had used the combination of queries to retrieve the percentage of each seller in Power Query Editor, to create a new custom column by multiplying sales by the percentage, but the result is not right. I tried to do the same with a calculated column, but I don't get the right amount.

 

Any ideas about how can I solve this issue? 

 

Profit Percentage for customer and seller.pngRelationship between data.pngVentas table with a Ventas calculated column.png Thanks to everybody for your support and help.

 

José Luis 

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jlarques 

 

yes, the relationship is only between the costumer numbers not between the product categories.

You have to generate a key column for the combination of customer and product categorie.

Relation_Solic.png

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

9 REPLIES 9
jlarques
Helper V
Helper V

Hi @mwegener 

 

the model is only an example. Tell me what you think I must change to become consistent.

 

Thanks.

 

 

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jlarques ,

 

I think for a relationship the Porcentaje should always add up to 100%.

As you can see in my screenshot, it is currently 300% for the customer.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi @mwegener 

 

you're right and maybe this is the reason because the amount is not 50% in the case of Johnson Stone costumer, as you can see in the image below.Error percentage.png

The amount for each seller would have to be 719.374,45€ instead of 3.451.673.15€.

 

Do you know if the relationship is the reason?

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jlarques 

 

yes, the relationship is only between the costumer numbers not between the product categories.

You have to generate a key column for the combination of customer and product categorie.

Relation_Solic.png

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jlarques 

 

try this Measure

 

 

VENTA =
SUMX (
    'Reporte de Pedidos';
    SUMX (
        RELATEDTABLE ( 'Cliente x Comercial' );
        'Reporte de Pedidos'[VALOR] * 'Cliente x Comercial'[Porcentaje]
    )
)

 

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi, @mwegener 

thanks for your quick answer. 

I tried to create a new calculated column with the total sales depending on the percentage, but the result is the same, as you can see in the images belowResult of the percentage.png.

 

The quantity is the same when I create a new measure.

 

Thanks again for your help.

 

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jlarques ,

 

could you share a sample PBIX File?

 

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi @mwegener 

yes, sure.

https://arqsistemas-my.sharepoint.com/:u:/p/joseluis_arques/EVauGWm1mFdOscPOx-m9FOQBLrj9Gxdq_1f-O7Ar... 

 

Please, tell me if you can access or not.

 

Thanks again.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jlarques ,

 

in my opinion, the DAX result looks good in the report.

But I'm not sure if your model is correct (consistent).

Porcentaje.png

 

If I answered your question, please mark my post as solution, this will also help others.

Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.