Filtering a Pivot Table by a Large Dimension - excel

I have a very large dimension in my OLAP cube - a customer dimension. Each customer has her own unique ID. I require a pivot table to be filtered for a single specific customer (ID).
Unfortunately Excel Pivot table takes very long to display the appropriate customer ID (checkbox) in the report filter.
It also does not help to pre-select customer from a specific town or birth year - it seems that all customers are scanned anyway.
How can I speed up this process?
Is there maybe a specific setting/property that I can apply in the SSAS solution?
Would attribute relationships help?
Can I maybe pre-calculate something in the cube?
Maybe I should add an additional attribute to the dimension?

Try Olap Pivot Table extensions for Excel. You can insert a filter list without having to wait for the costly excel filter.

You could add an attribute hierarchy to the customer dimension ItIsJoeBloggs. In the customer dimension table this would be True for the JoeBloggs rows and False for all others.
Then in Excel this hierarchy could be an additional filter with True selected.

Related

Excel PowerPivot Measure For cumulative total (of only the visible cells in a Pivot Table) for underlying OLAP data

I am trying to provide on of our FHF fundraising campaign managers with a tool they can use to help them pick postcodes to send a campaign to.
Spoecifcally, I'm seeking help writing an Excel PowerPivot Measure for a cumulative total that counts only the visible cells in a Pivot Table and wherein the source data is OLAP (i.e. an Excel Data Model - which seems to carry some constraints to possible solutions)
The linked worksheet is a simplified example of the excel worksheet tool I want to give to the Campaign Manager in a Fundraising setting https://www.dropbox.com/scl/fi/3pfc8ix2ekduoocsa90zs/minReprodExample_share1.xlsx?dl=0&rlkey=m6gqf5zbjxhl6dzkjq653it3d
We have two predictive models both giving different predicted response rates per postcode
The 'data' tab contains the raw data
The 'modelA_pivot' tab contains a pivot table ranking the raw data according to the predicted response rates from ModelA
'model_pivotB' does the identical pivot for ModelB
Focussing just on the 'modelA_pivot' tab for now
you can see a slicer that allows the campaign manager to exclude postcodes with only 3,000 addresses
(or some other threshold level of their choosing)
The slicer's exclusion of a single postcode with 3,000 addresses in this example is why you see the rank column in the pivot run; 1, 3, 4, 5
(i.e. missing rank 2 postcode with 3,000 addresses)
In the pivot, the last column - 'addressCount_postcodeCumulative_modelA' - is based on an excel Power Pivot 'Measure'
And the current formula of the measure is
=VAR rankCurrent = MAX([rank_modelA])
RETURN
CALCULATE(
SUM([addressCount_postcodePer]),
FILTER(
ALL(data),
[rank_modelA] <= rankCurrent
)
)
You can see in the 'modelA_pivot' tab the 'addressCount_postcodeCumulative_modelA' column
doesn't work or make sense. As it includes the cumulative total of ALL addresses (including the 3,000 addresses that are excluded from the pivot)
Can anyone help me with a 'Measure' formula that sums only the addresses of the postcodes that are visible and included in the pivot table
FYI and in case anyone is wondering, why a 'Measure'; I am using excel Power Query and Power Pivot so if/when the data upstream changes, the data team will be able to refresh this worksheet with a single click (more or less), and the campaign manager still gets to use excel (the tool they know and like)
But, the use of excel Power Query and Power Pivot and setting this up as an excel Data Model (which uses OLAP structured data)
is also injecting constraints which I'm hoping to fit the answer to this puzzle inside
Constraints such as;
I can't seem to put calculated fields onto the pivot table, and
I don't want to just add conventional excel columns on the side of the pivot table as the size of the pivot table is dynamic depending on choices of the Campaign Manager (like their choice of threshold # addresses in the slicer)

Using a fact table column for Power Pivot slicer

I have a couple measures in a Power Pivot data model to analyze activities by a group of consultants:
Total Activities = calculate(DISTINCTCOUNT(ServiceRecords[Activity ID]))
Service Status = if([Distinct Activities]>=5,2,IF([Distinct Activities]=0,0,1)). >> This is to assign a numerical status to customers based on volume of activities
I have a pivot table set up to slice by consultant and show the output of these measure against clients in rows.
I run into trouble when I add a new fact table (Addressable) to the model - this contains Yes/No feedback from sales as to whether a particular account is relevant for a particular consultant. This is linked to the original fact table with two typical index tables classifying consultants and classifying accounts. But the direction of the relationship is inwards from the index tables to this table.
What I'm trying to do is add a second slicer by the Yes/No field in "Addressable" to filter only the records that show Yes or No for the chosen consultant. I thought a CROSSFILTER measure was supposed to do this, but it ends up filtering the data behind calculation of the existing measures instead of just filtering the view. Any idea what I should be doing here?

SSAS Calculated member that knows if the user is using the report filter

I am trying to write a calculated member which acts differently depending on whether the user is filtering by that member or has it dragged down as rows or columns on their pivot table (using Excel).
The rules are:
1. If the user is using the date dimensin as a Report Filter in Excel, then the calculated member should get the maximum date out of all dates that they are filtered by.
2. If they have the date dimension as rows on the pivot table, then I need to apply ClosingPeriod and some other logic.
Please try this. The idea came from here.
Basically the dynamic named set represents what's in the report filters. And the EXISTING keyword trims the list of days down to the filter context of the current cell letting you detect say if one month is on rows. Compare counts and you can detect what the user did.
CREATE HIDDEN DYNAMIC SET CURRENTCUBE.SelectedDays as
[Date].[Date].[Date].Members;
CREATE MEMBER CURRENTCUBE.[Measures].[My Calc] as
CASE
WHEN SelectedDays.Count > {existing [Date].[Date].[Date].Members}.Count
THEN Tail({existing [Date].[Date].[Date].Members},1).Item(0).Item(0).Name
WHEN SelectedDays.Count < [Date].[Date].[Date].Members.Count
THEN Tail(SelectedDays,1).Item(0).Item(0).Name
END
Performance is going to not be good. And I suspect users will be confused with the results of your calc. If you want to describe the business scenario more I can maybe recommend a better approach.

Combine pivot tables with different but compatible measures?

I have a pivot table that displays agencies in rows, products in columns and sales units as values. I have to make up a report in this format:
Data is coming from an SQL Server Analysis Services and the "Estimate 2015" measure is a different measure (but uses the same dimensions and granularity so it is in fact possible to display the values side by side).
I could add a separate pivot table for the estimates, but then filtering or sorting the two tables will make them loose sync.
Is it possible to somehow align or combine pivot tables with different measures nicely?
if you are using Excel 2013, then you can use the data-model feature with standard pivot tables.
You need on your workbook:
3 dimension tables for agencies, products and year. All rows must contain distinct values (Agency A-C, Product A-B, Year 2013-2015)
2 fact tables: the one with historical data (from SSAS), the second one with your forecast datas
then you just create a Pivot table from any of the Dimension table. At this step, check the box "Add this data to the Data Model".
You then pull the Dimension field from the three dimension table on the Pivot column and rows. Choose both value fields from the 2 fact table (Quantity).
Excel detect missing relationships. You have to build them manually between the two Facts tables and the three dimensions (total 6 relationships)
In this Excel-file you can see an example with your sample datas.
You can find on the web some step-by-step explanations like How to Build PivotTables Using Excel's Data Model Feature

PowerPivot - How to Filter Dimension to Get Value

I am working on a PowerPivot report that has the following tables/relationships:
FactTable:
SponsorId
OfficeId
Type
Color
Quantity
DimSponsor:
SponsorId
SponsorName
ProjectName
DimOffice:
OfficeId
Region
Country
Manager
NumberEmployees
Relationships exist FactTable to each of the two dimension tables.
I wish to create a calculated measure that is the SUM(Quantity)/SUM(NumberEmployees) which represents the average number of items processed by number of employees.
I believe I am having the problem listed here at PowerPivotPro FAQ
When I create a pivot table that has an X-Axis of [Region] with [NumberEmployees] as the only value it always displays the sum of ALL [NumberEmployees] regardless of any slicer selection (in this case, I created a horizontal slicer of [SponsorName]).
I am new to DAX and have struggled to find a formula to meet my needs. Is there any solution to this problem?
I found working examples of what I needed to accomplish on Marc Russo's blob. It is a matter of creating a custom measure that filters the Office table by the already filtered rows of FactTable.
As some of the comments on the page mention, it isn't as easy as drag-n-drop but it works.

Resources