One measure, two USERELATIONSHPs

Russ Skinner

New Member
Joined
Jan 10, 2013
Messages
29
In PowerPivot I have a ledger table related to a calendar table.

Relationship between the tables is Ledger[Paid Date] to Calendar [Date].

The ledger also contains a secondary date field [Bill Date]

I have successfully used the following measure to aggregate ledger outgoings by [Bill date] using the USERRELATIONSHIP function thus overriding the primary relationship.

=CALCULATE(sum(Ledger[Outgoings]),USERELATIONSHIP(Ledger[Bill Date],Calendar[Date]))

The ledger also contains a category field, CAT1, CAT2, CAT3 etc.

I'd like to be able to have a single measure that aggregates using the primary relationship for certain categories, but the secondary USERELATIONSHIP for others. I've attempted this using an If statement with no success.

Is there any way of achieving this?

Thanks,

Russ
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Certainly should be possible. I would think IF (ISFILTERED(Ledger[Cat1]), ...) sorta thing? Sometimes the location of the IF can get confused though (am i checking on a row level vs in aggregate), not sure what you tried of course.

Think I will need a bit more here though -- maybe what you tried that didn't work?
 
Upvote 0

Forum statistics

Threads
1,224,044
Messages
6,176,048
Members
452,701
Latest member
rfhandel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top