Forum Discussion

dmoggie's avatar
dmoggie
Icon for Helper I rankHelper I
5 years ago
Solved

Matrix Help. Avg instead of Total

Hi,

I have created a matrix with Max values. I need to display the avg of these values instead of the Max value in the Totals field. I know I can create the matrix using avg figures, but that is not what I am trying to acheive. 

 

Any help would be greatly appreciated.

 

  • Hi dmoggie ,

    Try the following formula:

    Measure = 
    IF(
      HASONEVALUE('Table'[Date]),
      MAX('Table'[Value]),
      AVERAGE('Table'[Value])
    )

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

8 Replies

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi dmoggie ,

    Try the following formula:

    Measure = 
    IF(
      HASONEVALUE('Table'[Date]),
      MAX('Table'[Value]),
      AVERAGE('Table'[Value])
    )

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

    Best Regards,
    Winniz

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • dmoggie's avatar
      dmoggie
      Icon for Helper I rankHelper I

      Hi Winniz,

       

      Thank you for your time.

       

      This is closer to what I am trying to acheive, although not quite correct. The values in the matrix are max values and the total now displays avg values, but not the avg of the data contained within the matrix.

       

      For example at 11:00:00 I would expect the avg to be 75.63. 

       

      I have a seperate calendar table and for the above page I filter by day of week, could this be causing an issue? When amending your code I seems to always get the highest value in the totals row.

       

      Again any further help would be greatly appreciated.

    • dmoggie's avatar
      dmoggie
      Icon for Helper I rankHelper I

      Good Afternoon Winniz,

       

      Thank you so much for your help.  Happy to confirm this is just what I required to progress my report.

       

  • Hi dmoggie 

     

    Download example PBIX

     

    Have you written a measure to get the MAX ?  If so then rewrite to use AVERAGE e.g.

     

     

    Average 11:00 = AVERAGEX ( 'Table','Table'[11:00:00])

     

     

     

    If your matrix has values in the Values wells, chnage the aggregation to Average

    Regards

    Phil

    • dmoggie's avatar
      dmoggie
      Icon for Helper I rankHelper I

      Hi Phil,

       

      Thank you for taking time out to answer my query. unfortunately this is not realy what I am after.

  • dmoggie 

    Please supply an example of what you actually want.  My solution shows the average in the total.  Maybe you meant something different.