Forum Discussion

AlexisOlson's avatar
AlexisOlson
Super User
4 years ago
Solved

SHA256 in Power Query (and DAX) -- Performance Analysis Tools?

Just to see if I could, I decided to try implementing SHA256 in DAX. I was partly successful but limited lack of recursion, which meant I had to unroll loops manually with a bunch of variables (like ...
  • lbendlin's avatar
    4 years ago

    I would flatten it out (make it back into a query) and then run Power Query Diagnostics on the steps that you are interested in.  It will take a long time but eventually it will come back with a couple of diagnostics queries where you can go into detail on the timing of each step.

     

    If you run the diagnostics on the function then you may not get the granularity you'd like. Frankly haven't tried that.

     

    They key here is patience, and a freshly started Power BI Desktop.  Those diagnostics result take ages to appear, and you may think they never come back.  Better step away, do something else and not look at the screen for a while...

     

    Once done you can safely delete the diagnostics query group.

  • ImkeF's avatar
    4 years ago

    Hi AlexisOlson ,
    hats off to this amazing function - and to provide an example of how useful a buffer can be.
    Never in my live have I been able to speed up a query with a single buffer like this.
    (But maybe this shouldn't be a surprise when triple nested iterators are involved 😉 )

    Just add a buffer here and the results will be returned almost immediately:

     

     

        group_words = Table.Buffer( Table.Group(lists_table, {"chunk", "word"}, {{"w", 
            each List.Accumulate([u], 0, (state, current) => 256 * state + current), Int32.Type}}) ),

     

    BTW: This "trick" is included in my page with Power Query performance tricks here: Speed/Performance aspects – The BIccountant