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

metrics that depend on others and are recalculated

Greetings

 

I have a novelty with some calculations in dax since the result gives me a cyclical dependency.
Turns out I need that:
The measure Inv. Initial available when the month is 1 bring me the available inventory, otherwise you must bring me the value of the following month in the order of the month of the Final Available Inventory, but to calculate this final available inventory I must find the initial balanced requirements, these are calculated based on that initial available inventory that must be recalculated.
I share the heading of how the formulas are raised:

 

Inv. Disponible inicial = IF(ordermonth=1;Inv. Disponible;Inv. Disponible final)

 

Requerimientos brutos= MIN(1;ROUND(DIVIDE(([Inv. Disponible final objetivo]-( [Inv. Disponible inicial]-[Forecast Ventas]+ [CantidadenTransito])); [MOQ];0);0))* [MOQ]

 

Requerimientos Balanceados = max(0; [Requerimientos brutos]+ROUND(DIVIDE(max(0;([Inv. Disponible final objetivo]-( [Inv. Disponible Inicial - Balance 1]-[Forecast Ventas]+ [CantidadenTransito]))- [MOQ]); [Cant. Empaque];0);0)* [Cant. Empaque])

 

Inv. Disponible final =VAR Periodo= 'MPS Fenix'[Orden Mes]

Var Referencia= 'MPS Fenix'[REFERENCIA ACTUAL]

Return

MAX(Inv. Disponible inicial + CALCULATE(sumx(Table; [CantidadenTransito]+[ Requerimientos Balanceados]- [Forecast Ventas]);FILTER(ALL(Table); [REFERENCIA ACTUAL]=Referencia && [Orden Mes]<=Periodo));0)

 

This image shows us the information and the desired result in red:

 

 

cicli.PNG

 

thanks

2 ACCEPTED SOLUTIONS
AlexisOlson
Super User
Super User

You cannot recursively define columns in DAX but sometimes there are workarounds using cumulative totals.

 

For examples of workarounds, take a look here and at the linked posts here.

View solution in original post

v-shex-msft
Community Support
Community Support

Hi @jdtobon88,

Did these calculations work with simple cumulative on your records or complex recursive? AFAIK, power bi data model table does not include row and column index so they can't do the recursive calculation as excel worksheets.
I'd like to suggest you do these calculations in excel and get the result records to power bi to design visualizations.

Previous Value (“Recursion”) in DAX – Greg Deckler
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

6 REPLIES 6
v-shex-msft
Community Support
Community Support

Hi @jdtobon88,

Did these calculations work with simple cumulative on your records or complex recursive? AFAIK, power bi data model table does not include row and column index so they can't do the recursive calculation as excel worksheets.
I'd like to suggest you do these calculations in excel and get the result records to power bi to design visualizations.

Previous Value (“Recursion”) in DAX – Greg Deckler
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
AlexisOlson
Super User
Super User

You cannot recursively define columns in DAX but sometimes there are workarounds using cumulative totals.

 

For examples of workarounds, take a look here and at the linked posts here.

TomMartens
Super User
Super User

Hey @jdtobon88 ,

maybe this article and the available pbix provides ideas on how to tackle your challenge: Using Table Iterators to calculate a future value - Mincing Data - Gain Insight from Data (minceddat...

If not, take the time to create an xlsx file that contains sample data that reflects your data model (tables, relationships, calculated columns). Add a sheet that uses the values from the sample data and use Excel-Formulas to create the result you need. Upload the file to onedrive or dropbox and share the link.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hello, thanks for you answer.

 

this is the file https://www.dropbox.com/s/s3hi6dl8sqbvo6y/cycli.xlsx?dl=0

please help me @TomMartens 

Hey @jdtobon88 ,

 

I will have a closer look at the file you provided the next week.

I have to admit that I was expecting data that can easily be imported.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.