I’m trying to build in HistFactory a model of the form:

Data(x) = x Sig + (N-x) Bkg

where Sig and Bkg are my histograms, x is the signal yield (my parameter of interest to be extracted from the data), while N is the total amount of data which is fixed. I would do it rather easily in standard RooFit by using a RooFormulaVar to describe the term (N-x), but I can’t find a way of doing this with HistFactory using the AddNormFactor method… Any idea?

I think the Histfactory will build for you an extended model, i.e.

Data(ns,nb) = ns * Sig + nb * Bkg

where the parameters ns and nb are not contrained to be equal to N.
If you want to build a non-extended model, i.e. have N = fixed ns = x and nb = N-x, you would need to modify the built model by making the addition of the components (in the HIstFactory is typically done using the RooRealSumPdf class), by passing a single fraction parameter coefficients instead of both parameters representing the number of events in the two components.
See ROOT: RooRealSumPdf Class Reference