Forum Discussion
Dynamic average dax
- 5 years ago
Hi Anonymous ,
In that case do something like this:
CalcDAX =
var exp1 = COUNTX(Projects, Projects[Duration Stage 1])
var exp2 = COUNTX(Projects, Projects[Duration Stage 2])
var exp3 = COUNTX(Projects, Projects[Duration Stage 3])
var exp4 = COUNTX(Projects, Projects[Duration Stage 4])
var exp5 = exp1 + exp2 + exp3 + exp4
RETURN
DIVIDE(AVERAGE(Projects[Duration Stage 1])+AVERAGE(Projects[Duration Stage 2])+AVERAGE(Projects[Duration Stage 3])+AVERAGE(Projects[Duration Stage 4]), exp5, 0)
See if the above DAX works.
Thanks,
Pragati
Hi Pragati11
Thank you for your return. Unfortunately i can't. But I can tell that all Duration stages are calculated columns and they are present in one table.
Can you show me please how the dax is ?
Regards,
Hi Anonymous ,
In that case do something like this:
CalcDAX =
var exp1 = COUNTX(Projects, Projects[Duration Stage 1])
var exp2 = COUNTX(Projects, Projects[Duration Stage 2])
var exp3 = COUNTX(Projects, Projects[Duration Stage 3])
var exp4 = COUNTX(Projects, Projects[Duration Stage 4])
var exp5 = exp1 + exp2 + exp3 + exp4
RETURN
DIVIDE(AVERAGE(Projects[Duration Stage 1])+AVERAGE(Projects[Duration Stage 2])+AVERAGE(Projects[Duration Stage 3])+AVERAGE(Projects[Duration Stage 4]), exp5, 0)
See if the above DAX works.
Thanks,
Pragati