Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Hitman
New Member

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)

2017_10_18_08_18_55_Power_BI_Desktop.jpg

1 ACCEPTED SOLUTION

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"

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

visualvisualsee datasee 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.

4.PNG

Best Regards,
Angelia

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Hitman,

 

If i understand it correctly you want a count of all the sta.dev that are 0.5 or higher.

 

you could try this code:

Measure = COUNTROWS(filter(table1,table1[sta.dev]>=0.5))

I have'nt test it so let me know if it works !

 

 

regards,

L.Meijdam

Hi @Anonymous,

 

Thank you for your reply.

 

The chanllange for me is to get "table1".

Screendump is from "See Data" of the visual. Here the table is generated, but how do I do that with DAX syntax?

How can I get DAX to understand that the count/filter functions should be applyed after a list of standard deviations has been made?

 

Best Regards,

H.

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"

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

visualvisualsee datasee 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.

4.PNG

Best Regards,
Angelia

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.