Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Calculate measure (standard deviation) based on selection

Hi power bi community,   currently I struggle with calculating a measure, based on the filter selection. My data looks like the following:   The complete power bi app can be found here.   ...
  • TeigeGao's avatar
    TeigeGao
    7 years ago

    Hi Anonymous ,

    >>I mean, it is a general problem for me to calculate something based on what there is shown in the power bi matrix.

    In this scenario, we will need to use the measure rather than a calculated column, a calculated column will be calculated on whole data, the filter will not change it.

    We can create a measure using the following DAX query:

    STDEV1 = CALCULATE(STDEV.P(Tabelle1[Revenue]),FILTER(ALL(Tabelle1),Tabelle1[Country] = MIN(Tabelle1[Country]) && Tabelle1[Distinct Monat] in ALLSELECTED(Tabelle1[Distinct Monat])))

    The result will like below: 

    Best Regards,

    Teige