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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jasonrap
New Member

Count if greater than measure

Newbie here that needs some help.  

 

I am trying to do some statistical anlaysis of network performance data.  The key attribute I would like to do the analysis on is called values.  Within values are positive whole integers.  Thus far, I can get the min, max, average, and standard deviation.  Through a lookup table, I am able to calculate a value depending on how many standard deviations one is away from the average.  

 

What I would like to be able to do, is for a given standard deviation value, count how many data points are above that value.  I have tried many different methods to do this, but I keep hitting a wall and cannot get it to work. 

 

Here is what my current overview tab looks like.  for the CutoffValues, I would like to get a sense of how many rows have values greater than the cutoffvalues.  

OverviewTab.PNG

The measure Z is computed by:

Z = sum('myTable'[values])-AVERAGE('myTable'[values])/stdev.p('myTable'[values])
 
CutOffValues = 
CutoffValues = (stdev.p('myTable[values])*sum(SD[SDs to enumerate through])+AVERAGE('myTable'[values]))
 
[SDs to enumerate through] is just a custom table with values 1 through 10
 
RoundedZ = ROUND([Z],1)
 
Greatly appreciate the help!
 
Thanks, Jay 
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

@jasonrap 

Try  this slightly modified version:

CountedValues V2 =
VAR aux_ = [CutoffValues]
RETURN
    CALCULATE (
        COUNT ( 'pdom_onprem_connected-sessions_30s_60d'[values] ),
        FILTER (
            ALL ( 'pdom_onprem_connected-sessions_30s_60d'[values] ),
            'pdom_onprem_connected-sessions_30s_60d'[values] > aux_
        )
    )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

View solution in original post

8 REPLIES 8
AlB
Community Champion
Community Champion

Hi @jasonrap 

Assuming no relationship between the two tables, create a measure and place it in the table visual you are showing:

Measure =
CALCULATE (
    COUNT ( 'myTable'[values] ),
    FILTER ( ALL ( 'myTable'[values] ), 'myTable'[values] > [CutOffValues] )
)

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Thank you for the reply, I really do appreciate it! 

 

I created the following measure:

CountedValues = CALCULATE(COUNT('myTable'[values]),FILTER(ALL('myTable'[values]),'myTable'[values]>[CutoffValues]))

 
but no values are shown
OverviewTab2.PNG
Thank you

Hi @jasonrap ,

 

Any chance you could provide a sample pbix file?

 

Thanks,



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Sure, here is a link to the file: https://drive.google.com/file/d/1YB2jAJrENQpHB22biQjdJWHpIAtpTDG-/view?usp=sharing Hopefully that link works.  Thank you! 

Hi @jasonrap,

 

Looking now



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


Hi @jasonrap,

 

try the following

 

CountedValues = 
    var cv  = (stdev.p('pdom_onprem_connected-sessions_30s_60d'[values])*sum(SD[SDs to enumerate through])+AVERAGE('pdom_onprem_connected-sessions_30s_60d'[values]))
return
    CALCULATE(COUNTX('pdom_onprem_connected-sessions_30s_60d', [values]),
        FILTER(all('pdom_onprem_connected-sessions_30s_60d'),
        'pdom_onprem_connected-sessions_30s_60d'[values]>cv)
        )

Hope this Helps,
Richard
Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


AlB
Community Champion
Community Champion

@jasonrap 

Try  this slightly modified version:

CountedValues V2 =
VAR aux_ = [CutoffValues]
RETURN
    CALCULATE (
        COUNT ( 'pdom_onprem_connected-sessions_30s_60d'[values] ),
        FILTER (
            ALL ( 'pdom_onprem_connected-sessions_30s_60d'[values] ),
            'pdom_onprem_connected-sessions_30s_60d'[values] > aux_
        )
    )

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Richard and Super User III, thank you both for helping me with this!!! I grealy appreciate the assistance!  Bravo!  

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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