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
jlarques
Resolver I
Resolver I

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

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


View solution in original post

9 REPLIES 9
jlarques
Resolver I
Resolver I

Hi @mwegener 

 

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

 

Thanks.

 

 

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


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?

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


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


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.

 

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


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.

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


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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

Check out the March 2024 Power BI update to learn about new features.