Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Help Making an advanced standard deviation with filter based on a column

Hi everyone, i need help with this problem:

Look at this table:

[Sales]

 

Click Here 

 

And from that table i made this visual (The Standard Deviation value is 65.68)

 

The Standard Deviation that I need is not showing in this visual because is taking the values of [Average Sales Per day] and I need that takes the values like the table of the image #2 to take this Standard Deviation Result (114.39):

 

Thank You very much for reading.

  • stevedep's avatar
    stevedep
    6 years ago

    Thanks, that helps. See solution below:

    stdevm = CALCULATE(STDEVX.P(VALUES(Sales[Seller Name]);CALCULATE(sum(Sales[Average Sales per Day]))))

    as seen here:

     

     

    See modified Power BI file here

     

    If this is what you are looking for, please mark as solution. Kudo's appreciated.

     

    Kind regards,

     

    Steve. 

6 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    You need to use the STDEVX.P() function.  Please try this approach 

     

    Std Complex = STDEVX.P(VALUES(Table[Seller Name]), CALCULATE(Average(Table[Avg Sales Per Day])))
     
    Where Table is your table name and the column (not measure) is in the Average().  Having the Calculate is required (or you can just use your measure that is the average of that column instead).
     

    If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the response, in tried your recommendation but gave me another value the problem still look:
      The right value is 114.40  in this case.

       

      • stevedep's avatar
        stevedep
        Memorable Member

        Can you share a Power BI file with a sample of your data so we can work with this?