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
h2danilo
Helper I
Helper I

COMPARATIVO CUSTO VENDEDOR X RENTABILIDADE

Bom dia,

Estou precisando fazer um comparativo do custo do vendedor x Rentabilidade.
Tenho uma planilha (Vendas) com as vendas realizadas onde tenho um campo que é o Lucro que teve na Venda e quantos gerou de comissão ao vendedor e tenho uma tabela (Salarios) com o salario fixo por mês dos vendedores. 
Gostaria de agrupar vendedor, somando a qtde de meses que teve venda dele e multiplicar essa qtde pelo valor salario, conforme ex. "Modelo Desejado"

Alguém poderia me ajudar?Modelo Desejado.png

1 ACCEPTED SOLUTION

Hi @h2danilo,

 

Try this formula as a measure, please.

Measure =
SUMX (
    SUMMARIZE ( 'BI_Venda', BI_Venda[Ano], BI_Venda[Cpf_Vendedor] ),
    CALCULATE ( MIN ( BI_Salario[Salario] ) * DISTINCTCOUNT ( BI_Venda[Mes] ) )
)

The "Cross filter direction" should be Both.

COMPARATIVO-CUSTO-VENDEDOR-X-RENTABILIDADE

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-jiascu-msft
Employee
Employee

Hi @h2danilo,

 

If you have proper relationships, try this measure, please.

 

Demo Measure =
MIN ( 'Salarios'[Salario] ) * COUNTROWS ( 'Vendas' )

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi My friend,

 

This is my TablesThis is my TablesCorrect WayCorrect WayPower BIPower BI

Hi @h2danilo,

 

Try this formula as a measure, please.

Measure =
SUMX (
    SUMMARIZE ( 'BI_Venda', BI_Venda[Ano], BI_Venda[Cpf_Vendedor] ),
    CALCULATE ( MIN ( BI_Salario[Salario] ) * DISTINCTCOUNT ( BI_Venda[Mes] ) )
)

The "Cross filter direction" should be Both.

COMPARATIVO-CUSTO-VENDEDOR-X-RENTABILIDADE

 

 

Best Regards,

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Check this DAX formula, as a "new table", and see if works:

 

newtable = SUMMARIZECOLUMNS('BI VENDA'[CPF];"lucro da venda";SUM('BI VENDA'[LUCRO DA VENDA]);"Valor venda"; SUM('BI VENDA'[VALOR VENDA]);"comissão venda";SUM('BI VENDA'[Comissão venda]);"salarios";MIN('BI SALARIO'[SALARIO]) * COUNTROWS('BI VENDA'))
brunofs123
Frequent Visitor

Caro amigo brasileiro, sugiro você escrever em inglês! Aqui 99% das perguntas e respostas são feitas nesse idioma.

 

Hello fellow brazilian, i suggest you wrinting in english, because is the main language used in this community.

 

***

 

Em todo o caso, algumas dúvidas:

- Vc está usando EXCEL ou POWERBI?  Se for o primeiro, sabe usar POWER PIVOT/ e DAX? 

 

- Qual o resultado esperado, uma nova tabela "física" ? uma tabela como visual do PBI?

 

 

- Pode disponibilizar o dado no one drive? Fica mais fácil para "colar" as fórmulas

I'm Sorry my friend. I didn't know about default language!

 

Follows the example in MSSQL:

Example Table and Script

 

I would like to do it in Power BI. Salary of seller multiplied by amount of months that the seller had a sale

 

Best Regards

 

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.