Most of the times, you can chane the granularity (level of detail) of a calculation via the firms parameter of an AggregateX function (SUMX, for example). You can do that even if all you need is to show the results.
Can you post a sample of your data?
Thanks I tought sumx might have the key but cant get it to work
Table1 looks like this
[TABLE="width: 225"]
<tbody>[TR]
[TD]Inventory table[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Location#[/TD]
[TD]item #[/TD]
[TD]Onhand units[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
</tbody><colgroup><col><col span="2"></colgroup>[/TABLE]
Table 2 looks like this
[TABLE="width: 225"]
<tbody>[TR]
[TD]Sales[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Month[/TD]
[TD]item #[/TD]
[TD]sales units[/TD]
[/TR]
[TR]
[TD="align: right"]January-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]February-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]March-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]April-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]May-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]June-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]July-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]August-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]September-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]October-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]November-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]December-12[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]January-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]February-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]March-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]April-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]May-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]June-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]July-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]August-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]September-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]October-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]November-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]December-12[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[/TR]
</tbody><colgroup><col><col span="2"></colgroup>[/TABLE]
The measure I am trying to calculate is months of sale = sales units / on hand units *12
I can do this in dax and show the results in my pivot table no problem.
But what if I want to group the results?
I used a formula as follows to attach a grouping at the unit level
=if('Sales and COGS tel only'[MOS]<=3,"0-3",if('Sales and COGS tel only'[MOS]<=6,"3-6",if('Sales and COGS tel only'[MOS]<=9,"6-9",if('Sales and COGS tel only'[MOS]<=12,"9-12",if('Sales and COGS tel only'[MOS]<=18,"12-18",if('Sales and COGS tel only'[MOS]=9999,"No sale","24+"))))))
This works great on a power pivot by item. But I cant summarize the results by these groupings. That is becoause the context has to be at the item level for this calculation work
I am thinkin that in the power pivot I need to add a calculated measure as an added column to table 1. This should calculate months of sale for all items with the same item number.(ie lines 1 and 2 in tabel 1 both have item #1 in them - so my months of sale should use both these numbers to calculate the result). This can be summarized as follows
[TABLE="width: 520"]
<tbody>[TR]
[TD]Inventory table[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Location[/TD]
[TD]item[/TD]
[TD]Onhand [/TD]
[TD]Total Onhand for that item[/TD]
[TD]Sales[/TD]
[TD]MOS[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]117[/TD]
[TD="align: right"]93.6[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]117[/TD]
[TD="align: right"]93.6[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]48[/TD]
[TD="align: right"]24[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]48[/TD]
[TD="align: right"]24[/TD]
[/TR]
</tbody><colgroup><col><col span="2"><col><col span="2"></colgroup>[/TABLE]
Any thoughts are welcome
thanks