Forum Discussion

sd0021781's avatar
sd0021781
Regular Visitor
2 years ago
Solved

calculate average with filter

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi sd0021781 ,

     

    I’ve made a test for your reference:

    1\I assume there is a table

     

    2\Add a measure

     

    Average = AVERAGEX(
        FILTER(
            'Table',
            'Table'[Column1] <> "-"
        ),
        VALUE(SUBSTITUTE('Table'[Column1], "%", "")) / 100
    )

     

    3\Result

     

    Best Regards,

    Bof

     

     

6 Replies

  • sd0021781's avatar
    sd0021781
    Regular Visitor

    I have numbers in percentile and - in some filds. How to calculate the average excluding (-)? please help

    • rajendraongole1's avatar
      rajendraongole1
      Icon for Super User rankSuper User

      Hi sd0021781 - you average agent information measure should be this as below:

       

      Average Without Dash1 =
      CALCULATE(
          AVERAGEA('Averag'[Column1]),
          'Averag'[Column1] <> "-"
      )
       

       

      Hope it works.

       

      • sd0021781's avatar
        sd0021781
        Regular Visitor

        I calculated as you said but the result shows '0'. Expectation is to exclude dash and calculate the average of remaining numbers like

        -

        100

        100

        100

        0

        -

        100

        50

        -

        0

        100

         

        Expected answers after ignoring dash should be (550/8)= 68.75

        however i am getting 0 as an answer basis the calculation you have provided.

        I appreciate your efforts and looking forward to your next reply

  • sd0021781's avatar
    sd0021781
    Regular Visitor

    How to calculate average of the given numbers with (-) in some cells. I want to exclude (-) value while calculating

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi sd0021781 ,

     

    I’ve made a test for your reference:

    1\I assume there is a table

     

    2\Add a measure

     

    Average = AVERAGEX(
        FILTER(
            'Table',
            'Table'[Column1] <> "-"
        ),
        VALUE(SUBSTITUTE('Table'[Column1], "%", "")) / 100
    )

     

    3\Result

     

    Best Regards,

    Bof