SSAS Max calculation in cube - ssas

I have a dimension list of Product Codes and a measure called ACV in my cube. I need to be able to calculate the maximum ACV value for each product code.
I have got as far as the calculation below but that returns the sum of ACV for all products.
MAX([Products].[Product Code].[Product Code].Members, [Measures].[ACV])
I'd be grateful for input on how to resolve my problem.
Thanks!

If you want the maximum evaluated semiadditively by the grain of your model designed in the data source view, you should add a new measure (based on the same source field as the ACV measure) to your cube add set its AggregationFunction property to Max. More on aggregation functions in SSAS.

Related

Differences between cube measures and mdx measures

is there a difference between a native cube measure (for example Measure1) and this mdx measure :
Measure2=[Measures].[Measure1] ?
Because when I use these measures together I dont get any results, and when I use them one by one I get what I want.
So the Cube Measures are present at the time of cube processing where the "MDX measures"(correct name is calculations) are determined at the query time. You should try to use the Cube measures where ever possible.
Secondly they can be easily used together.

Sum-up and then calculate vs. calculate and then sum-up (SSAS-MDX)

I have a cube in SSAS multidimensional mode.
I have created a calculating measure in visual studio called "Total Cost". The formula is:
[Measures].[Unit Cost]*[Measures].[Qty]
It is in the lowest level of granularity (i.e. - the transnational level information has these fields).
The formula works well, as long as I present the data in this same level of granularity (for example, when I create a pivot and the rows are transaction IDs - like the source file)
However, when I present it in an aggregate format (for example - by customer) - then instead of making the calculation and then sum it up, it sum up and then calculate.
Here is what I expected:
Expected results vs. What I get
My understanding, that this is regardless a (correct/incorrect) hierarchy structure. In other words, I expected this calculation to work even without defining any hierarchy between the transaction ID level and the customer level.
I'd appreciate your help!
In your SSAS project ->datasource view, you need to add a named calculation. This would be "[Unit Cost]*[Qty]". Now add this named calculation as a Measure in your Cube. This do the job. This problem was already addressed in the following link.
https://stackoverflow.com/questions/53554284/how-to-multiply-two-measures-prior-to-aggregation/53558733#53558733

SSAS measure value aggregate error

I have a Fact table with the following rows
When I process my cube I want results like this :
However when procession my cube I get the following results:
I have fee rate (hourly rate) as a measure but it is summing the values when LineID is the same (see value highlighted in red), even though the dates and start times are different.
How can I change my Hourlyrate measure to only display the unique value and not a summation? I have tried changing the AggregationFunction to None but this gives me null values.
You've done a poor job of explaining your requirements and your issue.
Anyway, I would try changing the AggregationFunction for your Coll Fee Rate measure to Max. That will show the highest underlying value.
Try changing AggregationFunction for "Fee Rate" measure to AverageOfChildren
for more details
https://msdn.microsoft.com/en-us/library/ms365396.aspx
I managed to solve this by creating a Dimension table containing the fee rates and then used to this determine the rate

SSAS Dimension attribute as Calculated Measure

I am having some issues trying to implement an average of a dimension attribute.
The basic structure is:
Booking Header Dimension
Fact Table (multiple rows per Booking Header
entry)
On the booking header dimension I have a numerical attribute called Booking Window, and I want to be able to create a calculated measure that averages this value.
We are using SQL Server 2012 standard edition.
Any help would be greatly appreciated.
The best approach would be to create a measure group from the dimension table (in BIDS, go to cube designer, tab "Cube Structure", right-click the cube object in the Measures list, and select "New Measure Group", select your dimension table). BIDS will generate some measures, and you can remove all but two: the one based on your numeric attribute (I will call it "YourSummedAttrib" to have a name to refer to below), and the count measure. The aggregate function for the measure "YourSummedAttrib" will probably be "sum", leave that as it is.
Then, create a calculated measure which divides "YourSummedAttrib" by the count measure, which gives the average. Finally, if you have tested everything, make the two measures "YourSummedAttrib" and the count measure invisible before you give the cube to the users, as they only need to see the average, which is the calculated measure.
You can try this which should give you the average of that attribute across all members.
WITH MEMBER [Measures].[Booking Window Value] AS
[Booking Header].[Booking Window].CURRENTMEMBER.MEMBER_VALUE
MEMBER [Measures].[Avg Booking Window Value] AS
AVG([Booking Header].[Booking Window].[Booking Window].MEMBERS,[Measures].[Booking Window Value])
SELECT
[Measures].[Avg Booking Window Value] ON COLUMNS
FROM
[YourCube]
Hope that helps and apologies for any confusion on my part.
Ash
I tried to use the same idea, but without success. The solution I found was create a view with the calculated average and include a new group of measures.

MDX Measure Filtering

I am building a Mondrian Cube that shows information for a large range of dates. One of the measures for this cube is an average of a percentage value. Because some of the items in the cube should not make up the final average, I need to know how to filter them out based off this measure and only for this calculated member.
Found the solution to this thanks to the group over at the Pentaho forum:
http://forums.pentaho.org/showthread.php?t=75742