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

Average calculation for Nested IF

I am using nested if condition to calculate the measure in the front end and it is working fine for Monthyear dimension in pivot table.I need to calculate the average value for quarteryear .For ex- If Jan 2022 has 1 ,Feb 2022 has 0.75 and mar 2022 has 1 for below expression then quarter value should be (1+0.75+1)/3..Any help would be appreciated

if(
Sum(A) = '0' and Sum(B) >= '0',1,if(Sum(A) = '0' and Sum(B) < '0',0,
if(
((Sum({$<Month_year={'10-2022','1-2023','4-2023','7-2023','10-2023'}>}B)+Sum(C)+Sum(D)+Sum(E)+Sum(F))/(Sum(A))) < 0,0,if(
((Sum({$<Month_year={'10-2022','1-2023','4-2023','7-2023','10-2023'}>}B)+Sum(C)+Sum(D)+Sum(E)+Sum(F))/(Sum(A))) > 1,1,
((Sum({$<Month_year={'10-2022','1-2023','4-2023','7-2023','10-2023'}>}B)+Sum(C)+Sum(D)+Sum(E)+Sum(F))/(Sum(A)))))))

Labels (2)
0 Replies