Forum Discussion
Measure not included in average calculation
- Anonymous5 years ago
Hi Anonymous
Here I will show you two ways to achieve your goal.
Way1: You can use [Measure Adj_Avg] as the basic and calculate the average of this measure to get correct result in Total.
Way1 = AVERAGEX('Date',[Measure Adj_Avg])Way2: Try this measur, to get correct result directly.
Way2 = VAR _T1 = ADDCOLUMNS ( 'Date', "Average of Billed", CALCULATE ( AVERAGE ( Billed[Billed] ), ALLEXCEPT ( Billed, Billed[Date] ) ), "Average of Planned", CALCULATE ( AVERAGE ( Planned[Planned] ), ALLEXCEPT ( Planned, Planned[Date] ) ) ) VAR _T2 = ADDCOLUMNS ( _T1, "Adj_Avg", IF ( [Average of Planned] = BLANK (), 10, [Average of Billed] ) ) RETURN AVERAGEX ( _T2, [Adj_Avg] )I build a sample like yours.
Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous5 years ago
Hi Anonymous
I build a sample to have a test, but the measure in my sample works well.
Employee:
Billed:
Planned:
Relationship:
Measure:
Measure = IF(AVERAGE(Billed[Heures facturées]) <20,1,0)Measure 2 = SUMX('Employee',[Measure])Result:
I think your problem should be caused by your data model, please check your data model. Employee Table should have all employee name in it. Or you can try Way2 to build a summarize table by code and calculate the result in the summarize table.
If this reply still couldn't help you solve your problem, I suggest you to submit a new post with more details about data model. Our Employeers will help you solve your problem as soon as possible.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Greg_Deckler ,
The return statement is your formula! hehe. But to answer your question, the return statement you were meaning is Criterias. I put it as a variable to make it easier for me to understand your formula.
Var Planned = AVERAGE('Données_SAP'[Billed])
Var Billed = AVERAGE('Données_Staffing'[planned)
Var Criterias=
IF(and(planned=blank(),billed=blank()),blank(),
if(and(planned=blank(),billed>0),10,planned))
However, I still unfortunately really don't get how to use your formula.
Here are my tables
I know where to put the return statement, but for the rest…
Adj_Avg_Total_Measure =
IF(
HASONEVALUE(
'Table'[Thing]),
Criterias,
AVERAGEX(
SUMMARIZE('Table',[Thing],"__Measure",Criterias),
[__Measure]
)
)
- Which one of the three tables I should use in the formula?
- What should I put for _Measure?
- What should I put for [__Measure]?
Thank you very much for your patience!
Anonymous I am thinking the table with the Bureau column in it? Or you might be OK with your Date[Date] column. Depends on how the visual is setup. The [Measure] should be:
[Measure Adj_Avg]. The [__Measure] you leave alone.