Unexpected Excel Pivot behaviour with SQL Server Tabular model - excel

We use Excel from Office 365 with a SQL Server 2019 Tabular model
I have a "strange" behaviour of Excel Pivot regarding the level at which calculations are requested from DAX.
We have a measure that behaves differently depending on the granularity level you query it at.
In the example above, the measure is queried at "BRAND_NAME" level with some filters.
The sum of the Brand numbers does not equal the total, which is "fine" as it is a known side effect of that measure in this particular query.
Now, if we add a layer underneath, then the Excel Pivot shows a behaviour that is a problem for us
I'll do my best but it is not easy to explain...
What the Excel pivot is showing us is
the TOTAL_SALES_UNIT for the Item SAMSUNG "SP 54J8 HFR" (evaluated at ITEM Level)
the TOTAL_SALES_UNIT for the Item SAMSUNG "TRADE MODEL" (evaluated at ITEM Level)
the TOTAL_SALES_UNIT for the Brand "OTHERS" (evaluated at BRAND Level, probably because there is no record underneath the "OTHERS" Brand...)
Our measure TOTAL_SALES_UNIT is complicated and coded in such a way that it would return 0 if evaluated at ITEM level under the OTHERS brand...
BUT there is no ITEM under the OTHERS Brand and it looks like Excel Pivot somehow decides to evaluate our measure at the Brand level instead of the Item level...
Running a similar request under SSMS returns the result we were expecting
Question: Is there a way in Excel that we could control this pivot table behaviour?

Related

Excel Pivot Table filters values changing on source update

In our BI infrastructure we're using Excel's pivot tables to expose the data in an Analysis Service instance (the cube), and thus far we have nothing to complain about.
Excel "reports" can be defined containing pre-selected dimensions as rows, columns and filters, for example we can set the Time dimension as a column slicer, or the Country dimension as a filter slicer. This allows the users to access this pre-defined report with the slicers already in place where they just have to select there own values to slice with if needs be.
However, even tough this is working perfectly the issue emerges when we try to actually pre-define specific values in a filter slicer. These values are getting "randomly" changed after a few days without any particular pattern from what we can observe. (Note that the cube i.e. the data source is being updated daily)
For example, we want to create a report were the users would have the data already filtered by the countries Italy and France upon opening it. So we created a report where we have the Country as a filter slicer and the countries Italy and France set as specific slicers under the Country filter.
Now the problem is that this report would maintain it's structure and selected filter values for just a few days, after which Italy may get de-selected and Germany would now be selected, or only France is maintained as a slicer. And again, we can't seem to observe any particular pattern in these changes, neither the time it's taking to "lose its format", or the filter values being selected to filter with.
Furthermore, note that even tough the underlying data source is changing daily, the pre-selected values are always there and never deleted, i.e. Italy and France in this case, would always be available in the data source. In fact you could still select them in the report, even tough they are no longer selected by default.
Anyone can help us understand why this is occurring and what can be done to go around it?
EDIT
Just realized that the slicer which values keeps changing every once in a while, is a column in another table. For example the Country Italy is in reality a column in a table City and therefore can be found in multiple records such as Rome, Milan etc., and then is exposed as a dimension in SSAS.
In PivotTable Options/Data there is an option called: "Number of items to retain per field" which default is set to automatic.
I believe this might be what causes it to work at random, and then suddenly change. Try changing it to 'max'.
Install BIDS Helper and open Your source code in Visual Studio. Then run Dimension Health Check on the City dimension. I expect it will show some attribute relationship uniqueness issues. Fix the keys or attribute relationships and your problem should be fixed. If you need help knowing how to fix it post a screenshot of Dimension Health Check here.

How to visualize more attributes of a dimension in Pivot table in Excel 2016

I have a SSAS cube where one dimension is "User".
User has many attributes, say "Email", "Mobile Number", "Address" and (many) more.
I build a Pivot table in Excel 2016 where I can easily find which Users, for instance, placed orders in the current month.
Now, I want to visualize for each of these users several of the possible attributes: I just need to easily get the list of email and mobile numbers of the users that placed orders in the current month.
If I drag the required attributes in the Pivot table though, these are used to further split each row: under each User in the Pivot there will be a level with just one Mobile Phone and this will be further divided in one email and so on.
What I need is, instead, keeping the division of the Fact "Order" only by the dimension User, and for each User to just visualize some more fields.
What's the best way to achieve this?
The only way we can think of so far is to have an additional attribute with the concatenation (comma separated?) of all the needed information. But this is honestly horrible. The aim should be to have each of the additional attributes in its own excel cell.
I think you are looking for something like this ...
Pivot-Table options -> Display -> Classic PivotTable layout
For each field on your pivot table, Field Settings->Subtotals->None
From this raw data ...
And the options above, I generate this Pivot Table ...
I can't comment on Excel 2016, as I'm using XL 2013.
But in my pivot table, I can right-click on the default-displayed value for the dimension (I guess this would show the user Name for your User dimension - for me it's a Products dimension).[
Then select "Show Properties in Report", and select the one you want.
What it shows is what you get in the Tooltip popup when you hover over the cell. It doesn't seem to treat these extra values as extra dimension levels, with a Cartesian-product relation to the leaf-level you're looking at: it correctly just reads one value per leaf member.
Is there maybe some switch in your dimension design you need to flip to get Excel to do this? My dimension has these "properties" as dimension attributes, with AttributeHierarchyVisible=True, AttributeHierarchyEnabled=False.
I only have 2 of these defined (Current Product Code and ID). For some reason this Excel functionality also includes the immediate parent level of the leaf level in the hierarchy (Category) as a "property".

Actual KPI values Sharepoint Dashboard Designer are Calculating Weirdly

I am attempting to build a simple SharePoint Scorecard using the Dashboard Designer. The underlying list is an OOB Task List and the measured dimension is %-complete.
Each task obviously has a 1-100%. As a test KPI the goal for all "Assigned To" persons is to reach 100%. Ideally, in the future each person will have their own KPI and scorecard that can be adjusted, there will be a team roll up scorecard and all of those will roll into a dashboard.
However, I am struggling because when I create the KPI the "Actual" values seem to be multiplying by some weird factor.
Does anyone know why the actual values are showing as so large? I've tried other calculations than default and the values don't really change.
http://wayfaring.io/fotos/Screenshots/KPI-Issues.png
Okay I figured it out. It turns out that the underlying calculation of the data in the list needs to be changed from "SUM" to "Average".
Within the workspace browser (left pane) of Dashboard Designer under your Data Connections go into the list that populates your scorecard. Then go to the View tab. If you click Preview Data you can see the head of the dataset. Under the %-complete the default calculation is "SUM". Click that column header and then on the right pane (Details) change the Aggregation parameter from SUM to Average.
Save your changes and refresh the KPI in the score card and now I see the appropriate %-completes for each user.
Voila!

How to create m2m relationship in PowerPivot

So I am trying to link an employee metrics pivot chart with an employee project table with one slicer. I want an employee slicer that manipulates all charts but the data is coming from 2 different places (SQL, Sharepoint). When I try to create a relationship based on Employees I get the following error: "The relationship cannot be created because each column contains duplicate values. Select at least one column that only contains unique values."
So one chart has quantitative items while the table has qualitative items and I want one slicer to manipulate both at the employee level.
I want to see all the data on both charts for the selected employee, and not just single items linked by unique values. I can use unique values, and have created relationships that one slicer can manipulate however I only get one record at a time that way and therefore the slicer has thousands of buttons (one for each record).
I wouldn't think this would be that difficult and I hope it's really not.
Please Help!
M2M relationships in PowerPivot will most likely cause more headaches than solutions unless you are aware of what you are doing. After some thought, I realized that I really do not want an m2m relationship because it would result in junk data for what I wanted. I just wanted to start my answer off acknowledging that I did not achieve an m2m.
So if you want to link SharePoint data to Excel here is what you need to do:
Export SharePoint data as an RSS feed. If this is something others will need to refresh then the rss file will need to be stored on a shared drive.
Add PowerPivot if you have not already done so. In PowerPivot get external data from other sources (rss feed) then add your file. To link data you will need a Unique ID to join tables on.

SSAS Dimension Security Result in Excel Slicer

I have created a role in my Analysis Services cube (SQL Server 2012) and applied a dimension security so that only one of the dimension attribute's member is selected. When I use the cube in Excel 2013 with a slicer for that particular dimension attribute against a pivot table, i get to see only one item, which is exactly what i require. However, when I click on the slicer item, the values of the pivot table do not change, it shows the total values instead of values filtered for that specific dimension attribute member.
The weird thing is that when I view the numbers by browsing the cube, i get the correct number whereas in excel slicer when I click on the attribute member, it does not change pivot table values.
If I select 2 dimension attribute members to be allowed for the role, the excel slicer works perfectly fine and the pivot table values change when I click on either of the 2 dimension attribute members. I am not sure whether this is a bug in excel or there is something else I need to make sure before achieving the desired functionality?
Thanks.
Have you enabled visual totals? You click that check-box in under Advanced tab in Dimension Data page of role setup (see screenshots in this page: visual totals).
Visual totals make sure the results are recalculated to what ever the security is set to. If VT is not checked in, then AS shows you total value for the dimension, without security applied to it. It would not show any cousins etc, only the descendants of the member which security is applied on. It basically 'secures' the details, but not totals...

Resources