Solved

SSAS - COUNT OF A DIMENSION MEMBER

Posted on 2010-09-17
2
1,283 Views
Last Modified: 2016-02-14
Hello Folks,
I am trying to use count of a dimension member as measure.
My purpose is to count the distinct StoreID sales for the specified week of year. I have created a calculated member named StoreCount. And the formula of this calculated member is.



Count(CrossJoin({[Measures].[Sale Unit]}, [Dim Warehouses MAX].Members), ExcludeEmpty)




This calculation show the total count of the Sale Unit measure. But I have filtered this resultset for the week 17. And it still shows the all date range.

Any idea?
0
Comment
Question by:innocent1973
2 Comments
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 500 total points
ID: 33707152
Hi,

Your calculation makes no reference to your date dimension and so will not be fitered by it.

If the query you want to include the calculation in is doing something like:

nonempty( [Dim Warehouses MAX].Members, [Measures].[Sale Unit]) on rows

i.e. showing only those stores that have sales (for a week), then you should be able to just use:


Count(Existing([Dim Warehouses MAX].Members))

as your calculation. Note that this will only work if you include [Dim Warehouses MAX] in the crossjoin in your main query (otherwise there is no set of [Dim Warehouses MAX] to iterate over and you'll get the count of all stores in the dimension).

Tim
0
 

Author Closing Comment

by:innocent1973
ID: 33712418
Thank you
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question