Forum Discussion
DAX calculation from a table
- 5 years ago
@jcastr02 , please find the attached file after signature
jcastr02 ,
Hope you are doing like
divide(sum(Table[Terms]), Average(Table[Headcount]))
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
@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...
- jcastr025 years agoPost Prodigy
@Greg_Deckler Hello Greg, sorry about that, does this help?
Business Unit File_date1 Count Count Type
Miami 1/1/2020 581 Headcount Chandler 1/1/2020 704 Headcount Orlando Care 1/1/2020 699 Headcount Orlando Support 1/1/2020 1081 Headcount Muscle Shoals 1/1/2020 586 Headcount Muscle Shoals 2/1/2020 554 Headcount Orlando Support 2/1/2020 1100 Headcount Chandler 2/1/2020 729 Headcount Miami 2/1/2020 523 Headcount Orlando Care 2/1/2020 790 Headcount Orlando Support 1/1/2020 17 Terms Miami 1/1/2020 36 Terms Chandler 2/1/2020 31 Terms Orlando Support 2/1/2020 25 Terms Chandler 1/1/2020 64 Terms Orlando Care 2/1/2020 109 Terms Miami 2/1/2020 42 Terms Muscle Shoals 1/1/2020 19 Terms Orlando Care 1/1/2020 95 Terms Muscle Shoals 2/1/2020 23 Terms - amitchandak5 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.
- jcastr025 years agoPost Prodigy
In my visual, I'm showing it by month..... Query data provided below - + also screen shot of my visual table...
Attrition should be 12.55% (Sum of Terms / Average Headcount) and looking at this data by month
Query Data Business Unit File_date1 Count Count Type Miami 1/1/2020 581 Headcount Chandler 1/1/2020 704 Headcount Orlando Care 1/1/2020 699 Headcount Orlando Support 1/1/2020 1081 Headcount Muscle Shoals 1/1/2020 586 Headcount Orlando Support 1/1/2020 17 Terms Miami 1/1/2020 36 Terms Chandler 1/1/2020 64 Terms Muscle Shoals 1/1/2020 19 Terms Orlando Care 1/1/2020 95 Terms Muscle Shoals 2/1/2020 554 Headcount Orlando Support 2/1/2020 1100 Headcount Chandler 2/1/2020 729 Headcount Miami 2/1/2020 523 Headcount Orlando Care 2/1/2020 790 Headcount Chandler 2/1/2020 31 Terms Orlando Support 2/1/2020 25 Terms Orlando Care 2/1/2020 109 Terms Miami 2/1/2020 42 Terms Muscle Shoals 2/1/2020 23 Terms visual
- amitchandak5 years agoSuper User
@jcastr02 , please find the attached file after signature
- jcastr025 years agoPost Prodigy
@amitchandak I can't tell you how much I appreciate this!!! Thank you
- amitchandak5 years agoSuper User
jcastr02 , please find attached file after signature