Forum Discussion

Hitman's avatar
Hitman
New Member
8 years ago
Solved

Count Sta.Dev above a thredshold.

Hi,   I have a small problem with DAX... How do I count Sta.Dev above 0.5? (Concentrations are grouped by Month, Date and CowNo)
  • v-huizhn-msft's avatar
    v-huizhn-msft
    8 years ago

    Hi Hitman,

    Please create a measure using the formula and check if it works fine. 

    result =
    CALCULATE (
        COUNTROWS ( ALLSELECTED ( Table[Standardndeviation of concentration] ) ),
        FILTER (
            Table,
            [Sta.Dev] > 0.5
                && Table[CowNO] = "Standardndeviation of concentration"
        )
    )
    


    Table means your resource table. I test it using my sample table, it works successfully. Please see the following steps in my scenario.

    1. My sample table named "Table4"

    Table4
    2. Create a visual like you, click "See data", I want to count "Count of region"(the value in visual) above 1.

    visualsee data

    3. So I create a measure using the formula.

    result = CALCULATE(COUNTROWS(ALLSELECTED(Table4[Region])),FILTER(Table4,COUNTA(Table4[Region])>1&&Table4[Region]="B"))


    I will get the expected result.



    Best Regards,
    Angelia