Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Average with diferent total

Hi,

Can you help me? I have issues with this measure and I don´t know the reason.

 

name1ª VISIT2ª VISITCategoryTotal result
name102/06/2021 16:2923/06/2021 14:50382,8%
name202/06/2021 19:2823/06/2021 13:36348,0%
name302/06/2021 19:2923/06/2021 16:36392,4%
name402/06/2021 19:30 39,6%
name504/06/2021 6:50 328,8%
name604/06/2021 7:40 324,0%
name707/06/2021 10:15 312,0%
name807/06/2021 10:53 13,6%
name907/06/2021 11:32 115,2%
name1007/06/2021 11:45 15,6%
name1107/06/2021 12:00 18,4%
name1207/06/2021 12:25 18,8%
name1307/06/2021 13:12 14,0%
name1408/06/2021 10:41 316,8%
name1508/06/2021 11:59 211,2%
name1608/06/2021 12:15 314,4%
name1708/06/2021 12:40 318,0%
name1808/06/2021 15:07 28,8%
name1908/06/2021 15:59 214,4%
name2009/06/2021 10:04 36,0%
name2109/06/2021 10:56 19,2%
name2209/06/2021 11:36 28,8%
name2309/06/2021 12:05 29,6%
name2409/06/2021 17:27 29,6%
name2510/06/2021 11:00 330,0%

 

The total result: has the result of the inspections.

category: is a yardstick with the importance of installation

visit: are the dates of visit and can be once or twice

name: is the name of the facility.

 

And we need a measure. Average =the average of the visit but the total is the sum of the category average / category

 

Thanks a lot in advance

 

8 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    "And we need a measure. Average =the average of the visit but the total is the sum of the category average / category"

     

    About as clear as mud. Can you explain clearly what you need?

    • Anonymous's avatar
      Anonymous
      Not applicable

      the average of the "category total result" and the total is the average of the "category total result" divide by category

      • Anonymous's avatar
        Anonymous
        Not applicable

        Sorry. Same clarity as before.

  • Hi,

    You mean this?

    Measure =
    IF (
        HASONEVALUE ( 'Table'[Category] ),
        AVERAGE ( 'Table'[Total result] ),
        DIVIDE ( SUM ( 'Table'[Total result] ), SUM ( 'Table'[Category] ) )
    )

    Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you, but not, the first part is OK

      IF (
          HASONEVALUE ( 'Table'[Category] ),
          AVERAGE ( 'Table'[Total result] ),

      The problem is with second.

      I need also the sum average.

       

      Now I am using

      Total R = IF(HASONEVALUE(Table'[Name], AVERAGE( 'Table'[Total result] ), SUMX( Table, AVERAGE ( 'Table'[Total result] ) / SUM(Table[Category])).

       

      I don´t Know Why?

      But, Only it´s working if I filter "1 visit" by: Advanced filtering/ is no blank.

      And I don´t know why I need  that filter. I don´t have any blank and only it´s working If I do the filter on "1 visit".

      I have other table "Regions" and the masure it´s working ( with the filter is no Blank) in all Regions except two