Forum Discussion

krisplikj's avatar
krisplikj
Frequent Visitor
3 years ago
Solved

Standard Deviation from varying starting points

Hello Power BI enthusiasts,

 

Hoping someone can help here.  I have a data set that I need to calculate the stanard deviation for each row.  The catch is, I need the calculate it from the first "non zero" cell moving from left to right.  (or I could reorder the data points from right to left, if easier).  So, the first row would start on column 35, row 2 would start at column 36, row 3 at column 32, and so on.  It makes no difference if the best solution is simply by adding columns or DAX.

 

Many thanks in advance for any ideas and / or support.  Thanks!

 

 

  • Hi Ibendlin, thanks for the advice,  I'm going to close this thread and start a new one with the sample data in the correct format.  Best Regards.

     

3 Replies

  • krisplikj's avatar
    krisplikj
    Frequent Visitor

    Hello again,

     

    When I've posted in the past, I would normally get a solution relatively quickly.  Since this has not happened yet, I'm guessing with the way I presented the question below, a solution is not possible.  That said, I am rephrasing the question in a way that I believe there is a solution based off other questions I've seen solved.

     

    So in the previous screenshot, I had converted the dates into number of months from the current month and pivoted the data.  Here I have an unpivoted table where in another query, I found the min month of "non zeroes" by region and then merged queries with this one.  The "calendar year / month" column has 36 Months of data points while the "St Dev Lookup. Min Month" references the first "non-zero" month that occurred.  Can anyone tell me how to do a standard deviation on the "Test" Column where it only starts counting at the "St Dev Lookup.Min Month" occurrence?  And by the way, I do want to include any zeroes that occurred after the Min Month.  Kudos to anyone that can help and thanks again in advance!

     

     

     

    • krisplikj's avatar
      krisplikj
      Frequent Visitor

      Hi Ibendlin, thanks for the advice,  I'm going to close this thread and start a new one with the sample data in the correct format.  Best Regards.