cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Rotación de Cartera

¡Saludos Comunidad!

 

Requiero por favor de su ayuda con el cálculo de la rotación de cartera por mes:

 

 

Los datos utilizados son las Ventas a Crédito y el Saldo Final:

 

 

Por ejemplo, miremos el caso de diciembre de 2019:

Se toma el valor del Saldo Final del mes (diciembre) 11.891 menos Ventas Crédito 5.808 del mes (diciembre), nos da un resultado de 6.083; Luego este resultado lo restamos al valor de las Ventas Crédito del mes anterior (noviembre) 5.008, nos da un resultado de 1.074, así sucesivamente hasta que el valor sea negativo. Al compararlo con las Ventas Crédito del mes anterior (octubre) 4.820 nos da un resultado negativo -3.746.

 

El último valor positivo es 1.074 este valor se debe dividir con el valor obtenido de la fórmula (Ventas Crédito/30), 30 es una representación en días, este valor es fijo; En este caso 4.820/30 = 160.670.520. Ahora bien, el siguiente cálculo es 1.074/160.670.520 = 6,69

En este orden de ideas la Rotación de Cartera para el mes de diciembre del año 2019 sería 30+30+6,69 = 66,69.

 

Total.png

 

Rotación.png

 

Anexo Excel con los cálculos

https://drive.google.com/file/d/1R5xi0_I5UTu3XBcTh-EdtTMe5Su0ekdI/view?usp=sharing 

 

PBIX:

https://drive.google.com/open?id=1IRNI5bFrIV1lAAclLcpxhL7ccopPHkAG 

 

Nota: La idea es hacer esta fórmula en una sola medida en caso de ser posible.

 

Muchas gracias!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Rotación de Cartera

hi  @aamira 

Try this way as below:

Step1:

Add  Year and Month column in Dimdate table

Step2:

Create three measure as below:

valor = 
CALCULATE(SUM(Datos[Saldo Final]),FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&DimDate[Month]=12))-CALCULATE(SUM(Datos[Ventas Credito]),FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&DimDate[Date]>=MAX(DimDate[Date])))
MonthlyPortfolio Rotation = 
var _maxmonth=CALCULATE(MAX(DimDate[Month]),FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&[valor]<0))
return
IF(MAX(DimDate[Month])=_maxmonth,CALCULATE([valor],FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&DimDate[Month]=_maxmonth+1))/DIVIDE(CALCULATE(SUM(Datos[Ventas Credito])),30),IF(MAX(DimDate[Month])>_maxmonth,30))
Result = var _table=SUMMARIZE(DimDate,DimDate[Year],DimDate[Month],"_value",[MonthlyPortfolio Rotation]) 
return
SUMX(_table,[_value])

 

Result:

8.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: Rotación de Cartera

Lo sentimos, el uso de software de traducción, así que no estoy seguro de entender completamente. ¿Quizás un problema total de medidas? Si es así, ver mi post al respecto aquí: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Además, esta medida rápida, medida totales, la palabra final debe obtener lo que necesita:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Highlighted
Frequent Visitor

Re: Rotación de Cartera

Greetings Community!

 

Please require your help with calculating portfolio turnover per month 
 

The data used are Credit Sales and the Final Balance 
 

For example, let's look at the case of December 2019:

The value of the Final Balance of the month is taken (December) 11,891 less Credit Sales 5,808 of the month (December), it gives us a result of 6,083; Then we subtract this result from the Credit Sales value of the previous month (November) 5,008, it gives us a result of 1,074, so on until the value is negative. When compared to the Credit Sales of the previous month (October) 4,820 gives us a negative result -3,746.

 

The last positive value is 1,074, this value must be divided with the value obtained from the formula (Credit Sales / 30), 30 is a representation in days, this value is fixed; In this case 4,820 / 30 = 160,670,520. Now the next calculation is 1,074 / 160,670,520 = 6.69

In this order of ideas, the Portfolio Rotation for the month of December 2019 would be 30 + 30 + 6.69 = 66.69.

Highlighted
Community Support
Community Support

Re: Rotación de Cartera

hi  @aamira 

Could you please share your sample pbix file for us have a test? that will be a great help.

Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

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

Re: Rotación de Cartera

Highlighted
Community Support
Community Support

Re: Rotación de Cartera

hi  @aamira 

Try this way as below:

Step1:

Add  Year and Month column in Dimdate table

Step2:

Create three measure as below:

valor = 
CALCULATE(SUM(Datos[Saldo Final]),FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&DimDate[Month]=12))-CALCULATE(SUM(Datos[Ventas Credito]),FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&DimDate[Date]>=MAX(DimDate[Date])))
MonthlyPortfolio Rotation = 
var _maxmonth=CALCULATE(MAX(DimDate[Month]),FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&[valor]<0))
return
IF(MAX(DimDate[Month])=_maxmonth,CALCULATE([valor],FILTER(ALL(DimDate),DimDate[Year]=MAX(DimDate[Year])&&DimDate[Month]=_maxmonth+1))/DIVIDE(CALCULATE(SUM(Datos[Ventas Credito])),30),IF(MAX(DimDate[Month])>_maxmonth,30))
Result = var _table=SUMMARIZE(DimDate,DimDate[Year],DimDate[Month],"_value",[MonthlyPortfolio Rotation]) 
return
SUMX(_table,[_value])

 

Result:

8.JPG

 

and here is sample pbix file, please try it.

 

Regards,

Lin

Community Support Team _ Lin
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

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors