Forum Discussion

MichalHoltz's avatar
MichalHoltz
Frequent Visitor
9 years ago

Average of multiple cells

Hi,

I have the following table, with 24 columnes and 62 lines. How do I calculate the avarage of only the columns with numbers?

Is there a short way to calculate all in once?

3 Replies

  • CahabaData's avatar
    CahabaData
    Icon for Memorable Member rankMemorable Member

    If you mean the individual average per column - the table visual offers this option.

     

    If you mean the sum of all columns together - and then determining a single overall average; this would require a dax calculation.

     

     

    • MichalHoltz's avatar
      MichalHoltz
      Frequent Visitor

      Thanks. Can you suggest a DAx calculation?

      • CahabaData's avatar
        CahabaData
        Icon for Memorable Member rankMemorable Member

        here's a sample air code:

        measure

        Column X avg = Divide( Sum( Column X),

                                                   COUNT(Table, [Column X])

                                              )

         

        The count function only counts rows that have a number and should be ideal in your situation.

         

        Set it up for a single column.  Sanity check the result by temporarily using a Card visual to be sure the operation is correct.  Then you can string together this same formula to add multiple columns.