Hi community.
Please I am new to power bi and I am trying to solve a problem, I hope you can help.
I am trying to achieve a column that calculate based on the year.
e.g., if year = 2018, then sum all military budget for 2018 and divide it by the sum of # of miliary trainings. This should give same column for the expect result column for each year. Image below show the table.
avg budget for training =
var _costsperyear =
CALCULATE(
SUMX('Table','Table'[Military training budget]),ALLEXCEPT('Table','Table'[Year]))
var _trainingsperyear =
CALCULATE(
SUMX('Table','Table'[# of military trainings]),ALLEXCEPT('Table','Table'[Year]))
return
DIVIDE(_costsperyear,_trainingsperyear,0)