Forum Discussion
jcastr02
5 years agoPost Prodigy
DAX calculation from a table
I am trying to do below calculation Sum of Terms / Average Headcount as example using 1/1/20+2/1/20 ... 230+231 = 461 (Sum of Terms) 3651+3696 =7,347 / 2 =3,673.5 (average headcount) 4...
- 5 years ago
@jcastr02 , please find the attached file after signature
jcastr02
5 years agoPost Prodigy
@amitchandak Hello, please see screen shot of query above, the count type is in a different column ... I also provided an example in the screen shot in lower left side...
amitchandak
5 years agoSuper User
jcastr02 , Try
Divide(sumx(filter(Table, Table[CountType]= "Headcount"),Table[Count]),AverageX(filter(Table, Table[CountType]= "Terms"),Table[Count]))
or
Divide(sumx(filter(Table, Table[CountType]= "Headcount"),Table[Count]),Divide(SumX(filter(Table, Table[CountType]= "Terms"),Table[Count]),Countx(filter(Table, Table[CountType]= "Terms"),Table[Count])))
if this does not work out. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.