Forum Discussion
Calculating Average excluding MEASURE data
- 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
create PF as a column and use this measure to get the result
IF you want use PF As measure Change 'Table'[PF] to [PF] and remaining formula will be same
AVG PF2 =
VAR totalpf = CALCULATE(SUM('Table'[PF]),All('Table'))
VAR prjct1pf = CALCULATE(SUM('Table'[PF]),
FILTER(ALL('Table'),'Table'[Project]=SELECTEDVALUE('Table'[Project])))
VAR balance = totalpf-prjct1pf
VAR cnt = CALCULATE(COUNT('Table'[Project]),All('Table'))
VAR selectcnt = CALCULATE(COUNT('Table'[Proejct]),
FILTER(ALL('Table'),'Table'[Project]=SELECTEDVALUE('Table'[Project])))
VAR cntbalance = cnt-selectcnt
RETURN
Divide(balance,cntbalance,0)
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
- Fowmy5 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 🙂
- hackfifi5 years agoHelper V
hi Fowmy ...kindly note PF is a measure, so i modified your formula as below
Avg PF (Excluded) =VAR _Exclude = [Exclude?]RETURN AVERAGEX( FILTER( ALLSELECTED(Projects_Alias[Project]), _Exclude <> 1), [PF] )But i am getting the below result:- Fowmy5 years agoSuper User
hackfifi
Then use it this way, if it doesn't work, show the expected results based on your sample.Avg PF (Excluded) = VAR __Exclude = [Exclude] RETURN AVERAGEX( FILTER( ALLSELECTED(Table2), __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 🙂