Forum Discussion
hackfifi
5 years agoHelper V
Calculating Average excluding MEASURE data
Hello - Trying to develop a measure excluding certain data. Project PF Avg PF Exclude? Project 1 2.47 2.20 1 Project 2 1.54 2.20 Project 3 2.59 2.20 Cu...
- 5 years ago
hackfifi
I forgot to remove the variable, as it always stays static, please check now:Avg PF (Excluded) = AVERAGEX( FILTER(ALL(Table2[Project]),[Exclude] <> 1), [PF] )________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
hackfifi
5 years agoHelper V
Sorry VijayP it did not work...i was getting AVGPF2 value is 0
i have to use "ALLSELECTED" as i have over 100 projects in the dataset, but i have selected only 3
I am essentially trying to calculate the average PF of SELECTED PROJECTS where EXCLUDE<>1
Avg PF2 =
var totalpf=CALCULATE([PF],ALLSELECTED(Projects_Alias[Project]))
var project1pf = CALCULATE([PF],filter(ALLSELECTED(Projects_Alias),Projects_Alias[Project]=SELECTEDVALUE(Projects_Alias[Project])))
var balance = totalpf-project1pf
var cnt = CALCULATE(COUNT(Projects_Alias[Project]),All(Projects_Alias))
VAR selectcnt = CALCULATE(COUNT(Projects_Alias[Project]),
FILTER(ALLSELECTED(Projects_Alias),Projects_Alias[Project]=SELECTEDVALUE(Projects_Alias[Project])))
VAR cntbalance = cnt-selectcnt
RETURN
Divide(balance,cntbalance,0)
Fowmy
5 years agoSuper User
hackfifi
You may try this measure:
Avg PF (Excluded) =
VAR __Exclude = [Exclude] RETURN
AVERAGEX(
FILTER( ALLSELECTED(Table2[Project], Table2[PF]) , __Exclude <> 1),
Table2[PF]
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂