In AX you can create extra financial dimensions apart from standard dimensions - department , cost center, purpose.
You create one more dimension or use existing dimension as sub department - and original department as group and build a hierarchy by using department and sub department.