Kommentare zu: The Environment concept in M for Power Query and Power BI Desktop, Part 4 https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/ Wir lieben Microsoft Power BI Fri, 22 Mar 2024 16:27:23 +0000 hourly 1 https://wordpress.org/?v=6.7.2 Von: Richard https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-5118 Wed, 27 Sep 2023 10:47:13 +0000 http://ssbi-blog.de/?p=2747#comment-5118 Hi Lars,

I just wanted to say thank you so much for this series of articles. I’ve read three Power Query books trying to understand this behaviour and none of them covered it!

The best they do is explain that ‚each‘ is equivalent to ‚(_) =>‘ without touching on the implications when you use ‚each‘ more than once.

It now makes sense to me, FINALLY! 😀

]]>
Von: Piotr https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-3597 Tue, 19 Jul 2022 20:34:56 +0000 http://ssbi-blog.de/?p=2747#comment-3597 Thank you very much for such a great and in-depth explanation. Amazing learning experience.
Gentlemen’s, challenge for you, is how to calculate the running total by grouping as in your example however to use the if statement to evaluate if the next sum will result in a quantity greater than the current calculated row and if it does add a reference value to the current row before it calculates next step.
something like this.

]]>
Von: Lars Schreiber https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-788 Fri, 20 Dec 2019 09:29:22 +0000 http://ssbi-blog.de/?p=2747#comment-788 Als Antwort auf Taylor.

Hey Taylor,

thanks for your positive feedback 🙂 Calculating a running total the way Imke and I did it in this post, is REALLY slow and was just used for didactical reasons. You shouldn’t calculate a running total this way. Imke has spent some time on finding more performant ways to do that and she describes it on her own blog here: https://www.thebiccountant.com/2018/09/30/memory-efficient-clustered-running-total-in-power-bi/.

Have wonderful holidays,
Lars

]]>
Von: Taylor https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-787 Thu, 19 Dec 2019 18:29:45 +0000 http://ssbi-blog.de/?p=2747#comment-787 Thank you so much Lars for your write up of this formula and your contributions to the Power Query community. After adding the step with your code, it seems to be calculating correctly on my sample data, but when I implement with a large table (40.000 rows) the process is taking a long time. I have left PowerBI to calculate for about one hour, and only 41 rows have loaded so far. Is there something I can do differently to make it run faster?

Table.AddColumn(Added Custom3, „New Client Billed Amount“, each List.Sum(
Table.SelectRows(
#“Added Custom3″,
(Q) => Q[ProjectNumber] = [ProjectNumber]) [ClientBilledAmount]
))

]]>
Von: Michiel Soede https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-483 Sat, 06 Apr 2019 18:15:08 +0000 http://ssbi-blog.de/?p=2747#comment-483 Als Antwort auf Lars Schreiber.

Clear and indeed not sure when you would do so if you master dax (but that’s still a bit the area which requires some investment :-)). Thanks and keep up the good work

]]>
Von: Lars Schreiber https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-482 Fri, 05 Apr 2019 07:37:47 +0000 http://ssbi-blog.de/?p=2747#comment-482 Als Antwort auf Michiel Soede.

Hi Michiel,

thanks for your message. The running total in M was more a didactical example, than a best practise. There are not many scenarios that come to my mind, where I would create a running total in M, rather than in DAX (Imke is welcome to disagree here 🙂 ). Usually you need the running total to be computed when a filter is selected, and not while refreshing the model. This is why I never tried to compare running totals in M vs. DAX. Does that make sense?

Thanks,
Lars

]]>
Von: Michiel Soede https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-481 Thu, 04 Apr 2019 19:55:59 +0000 http://ssbi-blog.de/?p=2747#comment-481 Hi Lars and Imke, how is such a solution performing compared to a dax computer running total?
Either way nice solution which is definitely useful.
Thanks Michiel

]]>
Von: Giedrius https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-367 Fri, 21 Dec 2018 19:25:08 +0000 http://ssbi-blog.de/?p=2747#comment-367 Hello ! Thank you for your great article. I have a question: when I try to realize the more simple scenario (like in your picture „2. Result“ – just summing up the whole column without any grouping) and put it into a function, after I invoke the function from another query I get Error instead of total in the last column. In other words the query works fine when it is stand-alone, but gives me Error when I put it in a function. What could be of a problem here?

]]>
Von: Den https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-161 Thu, 11 Jan 2018 21:28:11 +0000 http://ssbi-blog.de/?p=2747#comment-161 Thanks for the article and the link to the official documentation (which I have not read before, except about the syntax of the individual functions). It was today that I understood with the similar use of nested functions, which were implemented by Imke in the solution https://social.technet.microsoft.com/Forums/en-US/1275f33f-71df-41ee-914f-c482d2f0678e/sumifs-in-power-query-rolling -12-months
Unfortunately for my task I could not find a solution. If you can, please see the question https://social.technet.microsoft.com/Forums/en-US/062b7459-493c-418f-975f-202e4d958024/sumifs-in-power-query

]]>
Von: Lars Schreiber https://ssbi-blog.de/blog/technical-topics-english/the-environment-concept-in-m-for-power-query-and-power-bi-desktop-part-4/#comment-153 Tue, 19 Dec 2017 12:38:21 +0000 http://ssbi-blog.de/?p=2747#comment-153 Als Antwort auf Frank Tonsen.

Hi Frank,

thanks for that hint. Already changed Outer to Inner. The code was different in the beginning, and after changing it „Outer“ didn’t make any sense. Good finding 😉

Cheers,
Lars

]]>