Forum Discussion
Employee FTE calculation
- 5 years ago
- 5 years ago
gottapu how about changing the code like this?
Employee FTE:=IF(COUNTROWS('Fact'),SUMX(ALL(Assignment[Asgn ID]),CALCULATE(MAX('Fact'[Assignment FTE]),ALL(RepGroup[Rep Group Name]),ALL('Fact'[Assignment FTE]))))
Thanks much wdx223_Daniel. Really appreciate you taking the time to replicate our scenario. Below solution has got me very close. We are displaying Assignment ID from dimension and when we do that Employee FTE and Assignment FTE are now showing same values (Employee FTE values not rolling up). But when we show Assignment ID from fact table, Employee FTE values are rolling up correctly. In reality, we have Assignment Number in our Assignments dimension that we show in our report. Appreciate, if you can let me know how best to adjust code when we are using Assignment ID from Assignment dimension in our report.
Thank you
-Raj
- wdx223_Daniel5 years ago
Community Champion
- gottapu5 years agoFrequent Visitor
Thank you so much wdx223_Daniel . I have been working on this calc for last few days and breaking my head. I am relatively new to Power BI DAX code. I have gone through Plural sight DAX videos and other DAX documentation available on web but still struggled to get to correct number. You have made my day. Thank you so much for going extra mile to help.
Thanks,
-Raj
- gottapu5 years agoFrequent Visitor
Hi wdx223_Daniel,
I have run into a slight problem where if I bring in additional column from another dimension, FTE values appears to be not rolling up. For example, I have Representation Group dimension that is connected to my fact on Rep group id field. For Example, Assignment IDs 21 has a representation group of 'Faculty' value and and Assignment ID 22 as a representation group of 'Clinician'. Though representation groups are at the assignment level, they are connected to Fact table using a different key (i.e Rep ID). Is there a way I can include Representation group in my report but still calculate FTE by Employee?
Output that I am looking for:
Employee Name Assignment ID Rep Group Assignment FTE Employee FTE A 11 Faculty 1 1 B 21 Faculty 0.5 0.7 B 22 Clinician 0.2 0.7 C 31 Faculty 0.3 0.7 C 32 Clinician 0.1 0.7 C 33 MG Fcaulty 0.3 0.7 Rep Group Table:
Rep Group ID Rep Group Name 1 Faculty 2 MG Faculty 3 Clinician For Employee B and C, I am getting same values for Employee FTE and Assignment FTE. Apreciate any further help.
Thanks,
-Raj
- wdx223_Daniel5 years ago
Community Champion
gottapu how about changing the code like this?
Employee FTE:=IF(COUNTROWS('Fact'),SUMX(ALL(Assignment[Asgn ID]),CALCULATE(MAX('Fact'[Assignment FTE]),ALL(RepGroup[Rep Group Name]),ALL('Fact'[Assignment FTE]))))