Over coming Many-To-Many

Comfy

Well-known Member
Joined
Dec 21, 2009
Messages
3,386
My Fact table consists of financial transactions.

Book1
AB
1AccountAmount
21234-60
31234-78
4456-80
5456-196
6987651
798718
898768
Sheet1


Normally when grouping account codes you would use 1-To-Many

Book1
JK
1AccountHeading
21234Income
3456Income
4987Expenditure
Sheet1


But I would like to use one table to group account codes for multiple KPIs, an account code might be used in one or more KPIs

Book1
EF
1AccountKPI
21234KPI1
3456KPI1
41234KPI2
5456KPI2
6987KPI2
7456KPI3
8987KPI3
Sheet1


Assuming the Measure was a simple sum the output would be:

Book1
AB
15KPIAmount
16KPI1-414
17KPI2323
18KPI3541
Sheet1


Can anyone assist?
 
Last edited by a moderator:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Maybe:

Book1
ABCDEFGHIJ
1AccountAmountAccountKPIAccountHeading
21234-601234KPI11234Income
31234-78456KPI1456Income
4456-801234KPI2987Expenditure
5456-196456KPI2
6987651987KPI2
798718456KPI3
898768987KPI3
9
10
11
12
13
14
15KPIAmount
16KPI1-414
17KPI2323
18KPI3461
Sheet1
Cell Formulas
RangeFormula
B16:B18B16=SUM(SUMIFS($B$2:$B$8,$A$2:$A$8,IF($F$2:$F$8=A16,$E$2:$E$8,"xx")))
 
Last edited by a moderator:
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,282
Members
452,902
Latest member
Knuddeluff

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