DAX Need Power Pivot Measure to be SUM of ALL Columns in Each Column. How to ignore column context - powerpivot

I have a Pivot Table with Salespeople as columns. I have income measures that correctly show (in the rows) the income each of them produced. However, I would like to show everyone's income in each column on some of the measures.
The reason is I want them to be paid on some income items (row measures) on the total of all salespeople not on their individual production.
Is there a way to make a measure ignore the column context?

DAX ALL
Try to use ALL function and give your column as a parameter.
It will clear currently applied filters.

Related

Filtering a DISTINCTCOUNT in DAX with a complex condition

I have a table products with some signs of participation in certain promotions.
The condition of promotion work like this:
Take any product from set 1 AND take any product from set 2
There is a big table of sales
and table about regions for sales of point
I need to make a calculated measure for promotion 1 as the unique number salepoint_id for points that fulfill the condition promo 1
I prepared a scheme in powerpivot
Added calculated fields
And measures
Result correct
but:
The sales table is large and the calculated field is not the best approach
It is assumed in the table to use a hierarchy (Year/Quarter/Month, Region/Territory) and therefore the use Allexcept becomes impossible
How to create a calculated measure that counts the number of unique sale points have complied with the condition of promotion based on the context of the PivotTable?
Download link example

SSAS Rank with respect to multiple measure and dimension

I've a Rank column in my report.
The logic behind the rank column is based on a Measure value (either a count or sum) and based on three dimensions.
For example,
I've to show a rank based on a Measure value (Total customers) of a
selected Company(which will be parameter for the report, which in turn
a dimension) based on Period (It can be anything year, half-yearly,
quarterly, monthly) and a product group
.
Even the measure value can be chosen as a parameter from the report which makes things complex.
How can I accomplish this?
I think I can use RANK function of SSAS for a calculated field along with ORDER.
But can we create one RANK function without hard coding the measure or dimension?
I would handle this by creating a stored procedure to return the data for my report.
The stored procedure would use the report parameters to build an MDX string and execute it on the SSAS server with OPENQUERY(). The MDX would only have to get the measure that the report is to be ranked by on Columns, and then Period and Product Group on rows.
Execute the MDX in the stored procedure, storing the result in a temporary table, and then SELECT from the temporary table using either the ROW_NUMBER() or RANK() function to add the Rank column to the output.

Is it possible to use an external field in the calculation for a pivot table column?

Let us say we have a pivot table, that lists different departments of a school district. (each department being a unique row).
The number of hours of work put in by each department is the 2nd column of the pivot table.
I want to create a 3rd column that lists "dollar amount" spent by each department.
The issue being 'hourly rate' is not part of the cube that is used to generate the pivot table.. The excel spreadsheet has a manually written table that has 2 columns, (Dept, hourly rate).
I am wondering if it is possible to use the external table column 'hourly rate' using my olap mdx calculation?
I think you're asking if you can add some sort of Lookup functionality inside a custom measure to find values that are in the spreadsheet but not in the cube. I don't believe this is possible.
What is possible is the following.
Create a pivot table looking at your cube - this is mine against the AdvWrks cube:
Now, with the pivot table selected, hit this button:
You can now add a standard vlookup formula and drag down the right hand side:
Notice how the slicer of the pivot table has remained - so all formulas are still linked through to your OLAP cube.
The above is possibly some sort of route you might like to explore as a workaround ....or just add some more information into the cube!!
EDIT
This is not a very elegant solution but it is a way you can add your rate into the pivot:
In here select "MDX Calculated Measures..."
Then for my advWrks prototype I added this mdx:
case
when [Product].[Product Categories].CURRENTMEMBER IS [Product].[Product Categories].[Category].[Accessories] then 0.5
when [Product].[Product Categories].CURRENTMEMBER IS [Product].[Product Categories].[Category].[Bikes] then 2.5
when [Product].[Product Categories].CURRENTMEMBER IS [Product].[Product Categories].[Category].[Clothing] then 5
else 1
end
*[Measures].[Internet Sales Amount]
The above measure is called fooBar and can now be used in the pivot along with any other measure:
If there are 600 categories then my case statement will be pretty ugly - but it seems to be functioning as expected.
the previous answer gives your best options with pivot tables.
XLCubed (full disclosure, who i work for) is an add-in which handles this sort of limitation in olap connected Excel, & your scenario is detailed below. Basically a grid (pivot table equivalent) retrieves the SSAS data, and you can then add a user calculated column containing any standard Excel formula, in your case a vlookup:
http://blog.xlcubed.com/2016/06/calculated-fields-are-not-available-in-an-olap-based-pivot-table/

What's an elegant way to find the minimum value in each row of a table?

I've got a table which has a row per product, and the price that product has on ten different merchants. What I'd like to see is the minimum price each product has among those different merchants.
In Excel this would be easy, because the MIN() function there works on any set of cells, whether they're arranged horizontally or vertically. However, MIN() in SQL only acts on columns, so I'd be able to find the cheapest price merchant 1 had across all products, etc.
Is there an elegant way to obtain the minimum price for each row? (Are there OLAP functions that would do this, or does the problem have to be approached using a loop?)
In PostgreSQL, you can do:
select least(price1, price2, price3, ..)
from products
LEAST gives you the minimum value of a list of values. It's the non-aggregate version of MIN.

combining multiple SSAS queries as one dataset

I have a fact-table with one date dimension linked three times to attributes for Ordered, Prepared and Shipped dates. So, I am able to get counts on ordering, manufacturing and dispatch and currently I am running these as three separate excel pivot table requests and combining them into one graphs giving three bars per month. I am wondering if there is a more sleek way I should be doing this by which I write a query which returns the three separate counts as individual measures rather than running the query three times doing it once against each dimension.
Currently, the fact table looks something like this: -
DEPID, PRODCODE, ORDERDATE, PROCESSDATE,SHIPDATE
001,001,20120101,20120102,20120104
002,001,20120103,20120105,20120106
003,002,20120104,20120106,20120107
004,002,20120105,20120107,20120108
You could create 3 calculated measures in the cube (Ordering Count, Manufacturing Count, Dispatch Count)...then just drag them into your pivot table in the values section and use a date dimension in the rows group.