cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rdiazd73
Helper I
Helper I

PREVIOUSMONTH & DIVIDE ERROR

Hola chicos
gracias de antemano por su ayuda

Necesito el porcentaje de crecimiento o disminución de un mes a otro, el problema aparece cuando el stock del mes anterior es 0, no calcula bien, me puede ayudar gracias

Captura.JPG

_PREV M 9l ?
CALCULATE(SUM('STOCKS ES FERT'[9L]);
PREVIOUSMONTH('FiscalCalendar II'[Fecha]))

_STOCK 9L - SUMX ('STOCKS ES FERT';
«STOCKS ES FERT»[9L])


_% PREV M 9l ?
IF(SUM('STOCKS ES FERT'[9L])>0;
DIVIDE(SUMX('STOCKS ES FERT';[ _STOCK 9L]);
CALCULATE(SUM('STOCKS ES FERT'[9L]);
PREVIOUSMONTH('FiscalCalendar II'[Fecha])))-1)

2 ACCEPTED SOLUTIONS
amitchandak
Super User IV
Super User IV

@rdiazd73 ,

Trate como

DIVIDE ([_STOCK 9L]-[_PREV M 9l]); _PREV M 9l])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

@rdiazd73

El mes anterior es 0, por lo que el % de aumento es infinito 2/0



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

4 REPLIES 4
amitchandak
Super User IV
Super User IV

@rdiazd73 ,

Trate como

DIVIDE ([_STOCK 9L]-[_PREV M 9l]); _PREV M 9l])



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Hola
gracias por su ayuda
su fórmula corrige parcialmente el error, ok el porcentaje erróneo desaparece,

pero debería proponer un porcentaje de crecimiento stock anterior mes 0 stock actual 2 porcentaje de aumento + 200%, no ?

Gracias

Captura.JPG

@rdiazd73

El mes anterior es 0, por lo que el % de aumento es infinito 2/0



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Greg_Deckler
Super User IV
Super User IV

Correcto, porque se está dividiendo por cero, pero parece que está utilizando el tercer parámetro de la función DIVIDE para tener en cuenta este tipo de error, ¿verdad? Tal vez sólo probar 0 en ese tercer parámetro?

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

@ me in replies or I'll lose your thread!!!

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!




Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors
Top Kudoed Authors