Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
aktripathi2506
Helper IV
Helper IV

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 6
Vvelarde
Community Champion
Community Champion

hi @aktripathi2506

 

AverageTotal = AverageX(Summarize('Table';Table[Group ];"MyAverage";[Measure3]);[MyAverage])




Lima - Peru

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.

@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] )
)

 

GroupNameSlicer.GIF

 

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

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

Hi @CheenuSing

 

Thank you for replying.

 

Measure 1 , measure 2 are not just column name they are acually measure calculate by other columns.

 

What I want to calculate is the average of [1-(measure1/measure2)]

Measure 1 is : SUM(table1[Hours Spent]) (after applying some page level filter)

Measure 2 is: total hour spent by the group by ignoring any filter/slicer except few which I have done by using the filter allexcept.

Measure 3 is simply : 1- DIVIDE([Measure 1],[Measure 2])

 

This is what I got by using the formula you suggested. When I selected another week from the week slicer. Again the result is not matching with the expected output.

 

GroupMeasure 1Measure 2Measure 3New Measure
A 51100.00% 
B9659.7598.60%100%
C20.5775.7597.40%100%
D 1100.00% 
E  100.00% 
F2.5731.7599.70%50%
G13.561.578.00%71%
H  100.00% 
I  100.00% 
J4623980.80%79%
K  100.00% 
L  100.00% 
M4.5411.7598.90%94%
N7428.7598.40%100%
O 174.75100.00% 
P12.5432.2597.10%99%
Q1.55697.30%0%
R14.75224.7593.40%79%
S  100.00% 
Total131.75424896.90%84%

@aktripathi2506

 

Hi; Try changing Measure3 to:

 

Measure 3 = AVERAGEX('Table';1-[Measure 1])/ [Measure 2])

 

And use the Dax that i wrote before

 

 




Lima - Peru
OwenAuger
Super User
Super User

@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 🙂


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.