Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Daniel29195
Super User
Super User

Iterator + related function

Hello,

Im confused about something , i would appreciate if someone demystify it 

 

First question : 

Does using related function inside an iterator create a transition context ? 

 

 

Second question : 

When creating nested iterators , first iterator im on row number 1 , 

Does the nested iterator knows the location of  the outer iterator  ans thus the nested iterator will be filtered based on the row context of the first iterator ? 

 

 

Hope my 2 questions makes sense 

 

Thanks for any explanation 

1 ACCEPTED SOLUTION

Hi, @Daniel29195 

As I understand it, the inner iteration function returns a new table, and the outer iteration continues to iterate over the new table generated internally.

For more information, you can refer to :

Iteration in DAX - Microsoft Power BI Community

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @Daniel29195 

Here are my understand about your question:

Q1:Does using related function inside an iterator create a transition context ? 

The RELATED() function just retun a related value from another table. The RELATED function needs a row context; therefore the function often uses in the calculated column and we can use SUMX, SELECTCOLUMNS function to create a row context.

 

Q2:Does the nested iterator knows the location of  the outer iterator  ans thus the nested iterator will be filtered based on the row context of the first iterator ? 

For nested iterators, this is mainly to look at the order of evaluation. Usually iterators such as FILTER(), SUMX() and other functions are iteration functions, when we use nested iterations, such as SUMX(FILTER()), then generally the FILTER() function is evaluated first, and then a table is returned, and then SUMX() iteration is performed on the generated table.

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hello @v-yueyunzh-msft , 

What i meant in my questions, 

What is happening behind the scenes 

For the 2 questions 

Like does the table in the inner iteration gets filtered by the row value of the first iteration ? 

If not, then what is  the logic ? 

 

 

 

Hi, @Daniel29195 

As I understand it, the inner iteration function returns a new table, and the outer iteration continues to iterate over the new table generated internally.

For more information, you can refer to :

Iteration in DAX - Microsoft Power BI Community

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors