Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

Count over Total Count on a Table

Hi good day,

Can someone help me on how can arrive on the result we required, Im not sure if this is possible. I have a table and I want to count the total E3 over the total number of Status No. per Trade per Area.

Table

DESIRED OUTPUT

Thank you

  • AllanBerces If you had posted that data as text I would actually have been able to test this but here goes anyway:

    Measure =
      VAR __E3 = COUNTROWS( FILTER( 'Table', [Status] = "E3" ) )
      VAR __Total = COUNTROWS( 'Table' )
      VAR __Result = __E3 & "/" & __Total // or DIVIDE( __E3, __Total, 0 )
    RETURN
      __Result
  • Hi AllanBerces 

    E3 Ratio Final = 
    VAR e3Count = CALCULATE(COUNTROWS(StatusData), StatusData[Status] = "E3")
    VAR totalCount = COUNTROWS(StatusData)
    RETURN
    IF(
        ISBLANK(totalCount) || totalCount = 0,
        BLANK(),
        VAR displayNumerator = IF(ISBLANK(e3Count), 0, e3Count)
        RETURN
        displayNumerator & "/" & totalCount
    )

3 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    AllanBerces If you had posted that data as text I would actually have been able to test this but here goes anyway:

    Measure =
      VAR __E3 = COUNTROWS( FILTER( 'Table', [Status] = "E3" ) )
      VAR __Total = COUNTROWS( 'Table' )
      VAR __Result = __E3 & "/" & __Total // or DIVIDE( __E3, __Total, 0 )
    RETURN
      __Result
  • Hi AllanBerces 

    E3 Ratio Final = 
    VAR e3Count = CALCULATE(COUNTROWS(StatusData), StatusData[Status] = "E3")
    VAR totalCount = COUNTROWS(StatusData)
    RETURN
    IF(
        ISBLANK(totalCount) || totalCount = 0,
        BLANK(),
        VAR displayNumerator = IF(ISBLANK(e3Count), 0, e3Count)
        RETURN
        displayNumerator & "/" & totalCount
    )