?
Solved

SSAS - COUNT OF A DIMENSION MEMBER

Posted on 2010-09-17
2
Medium Priority
?
1,350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Tim Humphries earned 2000 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
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.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

764 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