Multi family expense allocation

If I own a duplex, can I assign all expense to one unit or do I have to divide by the number of units?