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.
Hello,
I have successfully applied the solution from this post.
Now I would like to understand the logic.
scenario:
(simplified)
The task is to correct the data with the values from correction table, for given ID and months
I have this M formula, that WORKS:
let Source = Excel.CurrentWorkbook(){[Name="kons"]}[Content], zmenyBuf = Table.Buffer(zmeny), #"Added Custom" = Table.AddColumn(Source, "NovySl", (tempNazev) => Table.SelectRows(zmenyBuf,each tempNazev [m]>= [od] and tempNazev [m]<= [do] and tempNazev [ID]=[ID]), Value.Type(zmenyBuf)), #"Expanded zmeny" = Table.ExpandTableColumn(#"Added Custom", "NovySl", {"hod"}, {"NovySl.hod"}) in #"Expanded zmeny"
I would like to understand this part:
what is the purpose of tempNazev ? Is that just a placeholder?
(tempNazev) => Table.SelectRows(zmenyBuf,each tempNazev [m]>= [od] and tempNazev [m]<= [do] and tempNazev [ID]=[ID]), Value.Type(zmenyBuf)
Warm regards,
Jakub
Solved! Go to Solution.
It's not a function name, it's an input parameter of the function, you may refer to tutorials belew about custom function in power query.
http://radacad.com/writing-custom-functions-in-power-query-m
https://blogs.msdn.microsoft.com/mvpawardprogram/2013/08/19/creating-power-query-functions/
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Based on my understanding, this is because you use a Table.Buffer function before the add columns step. Table.Buffer will buffer a table into memory, isolating it from external changes during evaluation which means it's a temparary table and you can call it multiple times with out load table into memery again. It's very similar to a function parameter which is also not in disk memory.
So this question can be converted to "When and where should we use a buffer in power query", you may refer to similar cases below:
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@v-yuta-msft thank you very much for your answer.
I am getting the idea of buffered tables. In my example the buffered table is called zmenyBuf.
But I am still not sure about this syntax:
(tempNazev) => Table.SelectRows(zmenyBuf,each tempNazev [m]>= [od] and tempNazev [m]<= [do] and tempNazev [ID]=[ID]), Value.Type(zmenyBuf)
what is the function name of (tempNazev) => ?
Could you provide any links with more information about this syntax?
Warm regards
It's not a function name, it's an input parameter of the function, you may refer to tutorials belew about custom function in power query.
http://radacad.com/writing-custom-functions-in-power-query-m
https://blogs.msdn.microsoft.com/mvpawardprogram/2013/08/19/creating-power-query-functions/
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
94 | |
74 | |
71 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |