Forum Discussion

aktripathi2506's avatar
9 years ago

Calculating average for measure

I have 3 measures.

Measure 1, Measure 2 and Measure 3.

Measure 3 is getting calculated based on other two measure by using the formula:

 

Measure 3 = 1 – (Measure 1/ Measure 2)

 

Now I want to calculate the average of measure 3.

 

In power BI i am getting it as follows:

 

 

Group Measure 1Measure 2Measure 3
A  100.00%
B 64.75100.00%
C44090.00%
D 1100.00%
E 5100.00%
F330.00%
G  100.00%
H  100.00%
I15.581.80%
J 10100.00%
K223.591.50%
L 10.5100.00%
M 36.25100.00%
N  100.00%
O 13100.00%
Total10212.595.30%

 

 

In power BI I am getting 95.3% (1 -10/212.5) but this is not what I want...the expected output is the average of these numbers in measure 3 which should be 90.89%. I want to take the average of group efficency.

 

Please advise.

 

6 Replies

  • aktripathi2506

     

    You can use AVERAGEX to calculate the arithmetic mean of an expression across the values of Group.

     

    In your case, you could redefine Measure 3 to be:

     

    Measure 3 =
    AVERAGEX (
        VALUES ( YourTable[Group] ),
        1 - DIVIDE ( [Measure 1], [Measure 2] )
    )

    Or leave Measure 3 as is, and define an additional average measure:

     

    Measure 3 avg =
    AVERAGEX ( VALUES ( YourTable[Group] ), [Measure 3] )

    Owen :)

    • aktripathi2506's avatar
      aktripathi2506
      Helper IV

      Hi Vvelarde,

       

      I was using the similar formula before but not getting the result.

       

      I was using this equation: 

       

      _M_New2 = AVERAGEX(SUMMARIZE(Table,Table[Group],"toAverage",[Measure 3]),[Measure 3])

       

      answer I was getting : 0.72 (72%)

       

      This I changed to 

       

      _M_New2 = AVERAGEX(SUMMARIZE(Table,Table[Group],"toAverage",[Measure 3]),[toAverage])

       

      and now answer I am getting is: 0.53 (53%)

       

      Both are not giving the correct expected answer.

       

      Thank you.

      • Anonymous's avatar
        Anonymous
        Not applicable

        aktripathi2506

         

        If you follow OwenAuger approach it will give you the desired result.

         

        Only thing you need to do is change YourTable[Group] by YourTable 

         

        Measure 3 =
        AVERAGEX (
        YourTable,
        1 - DIVIDE ( [Measure 1], [Measure 2] )
        )

         

         

        If this is what are you want please accept OwenAuger reply as a solution and KUDOS to me and OwenAuger

         

        Cheers

         

        CheenuSing