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
rodneyc8063
Helper V
Helper V

Power Query M Code - {0}[Data] Meaning?

Apologies in advance for the cryptic forum title.

 

I am studying Power BI at the moment, and was going through this following article on Power Query M Code

 

https://docs.microsoft.com/en-us/power-query/power-query-quickstart-using-power-bi#the-advanced-edit...

 

In the example code given it states the following (very roughly)

 

let
    Source = Web.Page(.......),
    Data0 = Source{0}[Data],
    #"Changed Type" = Table........
    #"Changed Type1" = Table........
in
    #"Changed Type1"

 

I was looking at the example provided of the code in the "Advanced Editor" and I cant quite piece together what line 3 is doing in the code. 

 

Specifically the line that says

 

Data0 = Source{0}[Data]

 

If I understand correctly, Data0 is a new step which is equal to Source{0}[Data]. 

 

Source is referring to the previous step, and [Data] is a column.

 

So I am confused what is happening when its also got the extra {0} sandwiched in between?

 

I tried to search around, and the closest thing I could find was referring to {0} as possibly a "list", or a data value? But I think I am terribly off course here and was hoping for some guidance.

 

Thanks in advance

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User
2 REPLIES 2
amitchandak
Super User
Super User

Thanks so much for this!

 

That article is exactly what I am looking for 🙂

 

So to summarize, this is used for Power Query M language "cell navigation"

 

Taken from the article: StepName{RowIndexNumber}[Column] and this specific RowIndexNumber is one that is automatically generated by Power Query. Power Query has its own index and it starts from 0, so if you’re trying to get the first row of a list or a table, you’d use {0}

 

I was able to do further reading, and syntax wise its acceptable to either use 

 

StepName{RowIndexNumber}[Column] or StepName[Column]{RowIndexNumber}

 

These will both essentially produce the same result, but the difference is the sequence or order of steps. Either it can pull the record first, then the specific column OR it can just pull the column and then get the record. 

 

Thanks for the clarification! Again much appreciated!

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.