Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Count -> New Measure value

Hi Team,

 

I have done status column and next I want to count based on status column values for trend analysis.

 

I want the count of "Above" and "below" separatly. 

 

(New Measure)
Status = if([Gap]>0,"Above","Below")

 

Thanks,

KV's

  • Hi Anonymous 

    Try these measures:

    Status = if(MAX('Table'[GAP])>0,"Above","Below")
    
    Count of above = CALCULATE(COUNTROWS('Table'),filter('Table',[Status]="Above"))
    
    Count of Below = CALCULATE(COUNTROWS('Table'),filter('Table',[Status]="Below"))

     

    The outout would be as follow:

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

    Appreciate your Kudos  !!

4 Replies

  • Hi Anonymous 

    Try these measures:

    Status = if(MAX('Table'[GAP])>0,"Above","Below")
    
    Count of above = CALCULATE(COUNTROWS('Table'),filter('Table',[Status]="Above"))
    
    Count of Below = CALCULATE(COUNTROWS('Table'),filter('Table',[Status]="Below"))

     

    The outout would be as follow:

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

    Appreciate your Kudos  !!

  • Hi,

    If Status is a calculated column in your dataset, then in a Table visual just drag the Status column and write this measure

    Count = countrows(data)

    Hope this helps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ashish_Mathur 
      Thanks for your help,

       

      No, Status is new measure.

       

      Thanks,

      KV's 

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        Assuming Gap is a calculated column, try these measures:

        Status = if(MAX('Table'[GAP])>0,"Above","Below")
        Count of above = COUNTROWS(filter('Table',[Status]="Above"))
        Count of Below = COUNTROWS(filter('Table',[Status]="Below"))

        Hope this helps.