Excel 2016 pivottable pagefield will not let me use values that are working in MDX against the same SSAS cube - excel

I've got a few legacy (Excel 2016 VBA driven pivot table reports) reports which need to talk to a new SSAS cube I've made (Multi-dim as our server cannot support tabular yet).
Construction of most of the pagefields works except for Date which on the SSAS cube is a dimension linked to the facts via id and has a Date field with a real date value.
I have a custom C# DLL I've written which generates MDX for a user and with this I am successfully able to use WHERE [Date].[Date].[2022-12-07] however this fails in the VBA.
Fortunately I have OLAP EXtensions plugin so I checked the MDX that Excel was generating and it's using [Date].[Date].&[3] which is the underlying key. The key/ID changes currently as there's a rolling daily SQL prep stored proc/script preparing all of the data. I don't want to have to request the possible IDs first. I could just change the prep to use 1 & 2, as currently there's only 2 days of data, but in the future there will be more days/IDs at play.
Why can Excel not 'see' the Date values which MDX can (and returns valid data)? I added CubeFields to a watch and dug around in the various properties but I couldn't see anything...

Related

PowerPivot & Excel Row Level Security - How secure is this solution?

Afternoon All,
Before I begin, I know that you can't implement true RLS in excel - but due to pricing, Power BI is a non-starter. These excel models will also not be shared outside of my organisation.
The solution I'm using is obtaining the windows username via VBA, pasting it into a cell/table (on a hidden sheet) which is connected to the powerpivot model. My fact table then has a calculated column using 'filter' & 'contains' functions to check if the user is allowed access by comparing the fact row cost centre against a disconnected entitlement table, and returning either true or false. All measures are filtered to only include rows where the entitlement is calculated to be true.
The report uses pivot tables - via the PowerPivot window I've hidden all of the original value fields from client tools, forcing use of the measures. The workbook structure and VBA module are both protected. I'm also using vba to unlock the workbook, and refresh the power pivot model on workbook open.
I'm assuming the pivot cache would only include the measures not source fields, and the workbook structure is protected.I understand users could get lists of unsecured dimension data, but no facts.
My question is whether this a secure solution? Where are it's vulnerabilities? and is there a better solution?
The user needs to be able to interact and drill down on the pivot & an SSAS Tabular Model is not an option

Excel PowerPivot - change data source type

I have an Excel 2016 with 30 graphs based on PowerPivot. PowerPivot fetches the data from another Excel sheet, but I want it to get the data from a SQL server table instead.
How can I change the data source type in PowerPivot? I've tried looking in the Excel xml without any luck. Would be a lot of work re-creating all graphs over again just to switch data source
Thanks
Dennis
One suggestion I would make for the future, if all the users are using 2016 is to use Power Query which comes standard with that version of excel. In the Power Query loading data into Power Pivot scenario, all Power Pivot cares about is the column names. This means that the query can be changed between data source types without causing issues, as long as the same column names are changed.
As an example, I have one file that based on a parameter flag rips data out of a series of excel files on a shared network drive or Share Point. Both of which would be different data sources. The first opening a folder as the data source, then excel files listed within the folder. The other opening a share point list as its data source, then navigating though excel files.

SSAS 2012 Measure FormatString not reflected in Excel Pivot Table

We have been successfully using the SSAS 2012 Measure FormatString property for several years. We recently setup an additional server (SSAS Version 11.2.5058) and when connecting to a SSAS Cube on the new server via an Excel PivotTable the FormatString on the measure is no longer applied. Our users now have to format the numbers every time they pull in a new cube.
Additional Details:
EXCEL Version = 2016
Cube Connection Properties (Number Format is selected)
Click to see properties
Measure Format String configuration -- "#,##0.00;-#,##0.00" (note several standard and custom format strings were attempted).
Click to see configuration
SSAS Versions:
-- on the server that works correctly: 11.1.3000.0
-- on the server that is not working correctly: 11.2.5058.0
Does anyone know if there is an issue with the FormatString property for SSAS Cube measures in version 11.2.5058.0?

How do I get Excel to use Formatted_value in SSAS cube

TL;DR: What (Where) do I need to make changes in order to instruct Excel to use the format string to format the values pulled from the cube?
I have a SSAS cube that adds some calculated measures onto an existing user-defined function. On top of that, I use Excel and Power Pivot to display the data for the user. The user wants the resulting value (generally a number less than 2) to display with 2 decimal points.
In Visual Studio, I have added the following line to the MDX declaration:
FORMAT_STRING = "#,##0.00;-#,##0.00",
However, when I go to pull the data in using Excel, it doesn't use the formatting.
I have made sure that my connection configuration includes OLAP Server Formatting. I have also seen that Excel has a hard time with some of the formatting options such as "Currency" with certain language settings or case issues.
Edit: I have also made sure to refresh the excel connection, pulling in the data again.
What (Where) do I need to make changes in order to instruct Excel to use the format string to format the values pulled from the cube?
If this requires much work, would offering the user a template in Excel with the formatting set Excel-side offer the same capability? I am wondering specifically about the users removing the values and adding them back.
Edit: The version of Excel I am using is Excel Professional Plus 2010, version 14.0.7015.1000 (64 bit)
The issue was that the format statement was being set right after the declaration of the calculated measure. This placement wouldn't have been an issue if there were no scope statements afterward that modified the measure.
However, the addition of several scope statements related to the measure were present. Because of these, the FORMAT_STRING was being lost.
To fix this issue, the FORMAT_STRING must come after all the scope statements regarding the measure.
FORMAT_STRING([Measures].[Dimension]) = "#,##0.00;-#,##0.00";
After this code was added to the end of the MDX statement, Excel pulled the format correctly.

Measures as attributes when consuming data from a Power Pivot

I created a Power Pivot workbook that has information from our store (the plan is to connect to this document and consume the data), basically is something like this.
CostumerID | QtyPurchasedProductA | QtyPurchasedProductB | QtyPurchasedProductC ...
Everything is working fine when I use the Power Pivot data as a Pivot Table, but I when I upload the workbook to a SharePoint site and connect to the PowerPivot from another workbook, all of the measures (QtyPurchasedProductA , QtyPurchasedProductB, QtyPurchasedProductC) are shown as attributes instead of measures.
This happens with pulled from my database as well as custom DAX fields.
Any idea why this is happening? Is there a way I could specify on my Power Pivot Central Document? (the one I uploaded to sharepooint)
Thanks
When working with a pivot table (or pivot chart) based on a PowerPivot container local the workbook, Excel will "automagically" apply an aggregation function (Count, Sum, etc) to any field placed in the values/details section. My guess is that this "feature" is intended to make PowerPivot more user-friendly for the average business user...however I think promotes bad habits.
So, you'll want to go back in the local copy of your PowerPivot workbook and explicitly defined the measures. The easiest way to do this is to select the column and choose from one of the listed aggregation functions (see below):
For complex measures, you can use a DAX expression in the calculation area to define a calculated measure.
Once that's done, upload the PowerPivot workback back to SharePoint and you should see the measures when you connect to it and try to use it as a data source in other workbooks.

Resources