Solved

SSAS - COUNT OF A DIMENSION MEMBER

Posted on 2010-09-17
2
1,214 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Detach & Attach 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.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now