Forum Discussion

Mewan117's avatar
Mewan117
Frequent Visitor
3 years ago
Solved

AVERAGEX giving the wrong value

Hello Everyone, 
In the below table, I have calculated the Avg Time: Per Item with a measure. Which is the manifested_timings_total/Total items per orderID. Then I wanted the average of the Avg Time: Per Item, so I tried both the below functions

 

Avg of the Avg = AVERAGEX(VALUES('table'),CALCULATE(AVERAGEX(table,[Avg Time: Per Item])))
Avg of the Avg = AVERAGEX(table,[Avg Time: Per Item])

The expected value was 14.42. But I'm getting 14.46 as shown below.

Any suggestions on how to fix this? Any help would be appreciated. Thank you in advance. 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Mewan117 ,

     

    I think you can try to create a virtual table in your measure. Measure may look like as below.

    Avg of the Avg =
    VAR _SUMMARIZE =
        SUMMARIZE (
            'Table',
            'Table'[Statin ID],
            'Table'[Order ID],
            "Avg", [Avg Time: Per Item]
        )
    RETURN
        AVERAGEX ( _SUMMARIZE, [Avg] )

     

    Best Regards,
    Rico Zhou

     

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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Mewan117 ,

     

    I think you can try to create a virtual table in your measure. Measure may look like as below.

    Avg of the Avg =
    VAR _SUMMARIZE =
        SUMMARIZE (
            'Table',
            'Table'[Statin ID],
            'Table'[Order ID],
            "Avg", [Avg Time: Per Item]
        )
    RETURN
        AVERAGEX ( _SUMMARIZE, [Avg] )

     

    Best Regards,
    Rico Zhou

     

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