Forum Discussion

MindIsBlank's avatar
MindIsBlank
Frequent Visitor
6 years ago
Solved

DAX Version of Excel's DSTDEV

New to Power BI but have some experience with Tableau.   Looking to add a measure that calculates the standard deviation for unique categorical values in a column. For example, Column A has a categ...
  • MindIsBlank's avatar
    MindIsBlank
    6 years ago

    I figured it out. Had to use nested filtering described in this article from 2012.

     

    Measure code looks like this:

     

    calculate(
         STDEV.P(Column B)
         ,FILTER(
              ALL('Table')
              ,COUNTROWS(
                   FILTER(
                        'Table'
                        ,EARLIER(Column A) = Column A
                   )
              )
         )
    )