Using non dimension data in KPI (SSAS Cube) - ssas

I am trying to create KPIs for performance of students in each department and also across university.
The goal of average pass percentage of whole university is in a OLTP table and each departments have their own goal of average pass percentage in department OLTP table.
For department KPI, I could use the goal of average pass perecentage defined in department OLTP table in goal expression, because departement table is also dimension table; where as for university KPI, the goal of average pass percentage in university OLTP table is not accessible(via dimension table), because university table is not a dimension table. How can I access the goal of average pass percentage of university in goal expression of university KPI?

Related

hierarchy relationship power pivot

I m trying to show a table where sales are broken down by each sales person with their respective target
I would like to do it in the most efficient way as possible which I think mean fewer table as possible,
District are unique in Geographic split table,
I would like to show for each sales person their sales and target as in results table ..I think I ll have to go through hierarchy but I m not sure how to go about it
I have tried create a table for district and table for sales force with unique columns...but I can get them to show in one table without creating table for each type of sales force.
Thanks for any advice

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

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.

SQL - how to include average of a column in a report

Here's the scenario:
I have an Access project with tables consisting of the following data:
Activity table: ActivityName, ActivityPopularityRating
Volunteer table: VolunteerName, VolunteerRating
Each activity can have many volunteers and each volunteer has a rating.
I have to create a report which indicates for each activity, the names and ratings of the volunteers taking part in that activity, as well as the average VolunteerRating of the those volunteers taking part in each activity. An example is attached.
I have created the SQL query but I am not sure if I should generate the average value needed in the query, or if there is some function in Access that would allow me to do that in the report.
Here is my Query:
SELECT Activity.ActivityName,
Activity.ActivityPopularityRating,
StudentVolunteer.VolunteerName,
StudentVolunteer.VolunteerRating,
AVG(StudentVolunteer.VolunteerRating)
FROM Activity
INNER JOIN StudentVolunteer ON Activity.ActivityName = StudentVolunteer.ActivityName
GROUP BY Activity.ActivityName
All help is appreciated
Thanks
To add a total line (here showing the average rating) to your results, you would use UNION ALL in MsAccess (or ROLLUP in another DBMS). However, it is not necessary to add such line to your query. The data is already there (it is the avarage of the selected ratings, which can easily be calcualted from them).
So remove GROUP BY and the AVG line from your query and add AVG(VolunteerRating) in your report layer instead. The report will then calculate the avarage from the ratings.

SSAS - Is there a way to have a dimension relate to a fact table based on two columns in the fact table?

In SSAS is there a way to have a dimension relate to a fact table based on two columns in the fact table?
We have two tables: Location (Dimension) and Sales (Fact). The Location dimension has one column: "state". The Sales table has three columns: "saleAmount", "customerState" and "billingState" (because our customer can be in California but wants us to bill a company or branch in New York).
In SQL, if we want to see all the sales in California, we write our SQL query as:
select sum(saleAmount) from Sales where customerState = 'California' or billingState = 'California'
Is there a way to accomplish this in SSDT when building my cube so that when I'm using Excel as an end user tool and I select the state attribute from the Location dimension and the saleAmount measure, the saleAmount will be based on customerState or billingState? (I do not want to have role playing dimensions here - where one Location dimension is based on customerState and another Location dimension is based on billingState. I want one dimension matching up with both columns at once.)
Not the way you're thinking, but you can achieve what you want by doing this:
Create a view on your fact table, that is a UNION of facts related to customerState and facts related to billingState. This means the view will only have 1 State column, and if a fact has different values for customerState and billingState, then it will have two rows in the view.
Use the view instead of your table to populate your measure group in the cube.
Link the measure group to the Location dimension on the single State column in the Fact view.
Builder beware, this results in duplicate counting of facts when rolling up states where a single fact is in two different states.

SSAS Aggregation on Distinct ID

I wish to change the default aggregation from SUM to SUM on Distinct ID Values.
This is the current behaviour
ID Amount
1 $10
1 $10
2 $20
3 $30
3 $30
Sum Total = $90
By default, I am getting a sum of $90. I wish to do the sum on distinct ids and get a value of $60. How would I modify the default Aggregation Behavior to achieve this result?
Design your data as a many-to-many relationship: create one table/view having one record per ID and the amount column from the data shown in your question (the main fact table), and one table/view having one record per record of your data as shown in your question, presumably having another column, as otherwise it would not make any sense to have the data as shown in your question). This will be the m2m dimension table. Then, create a bridge table/view having the id of the m2m dimension table and your ID column.
Then create the following AS objects: A measure group from the main fact table, a dimension on column ID of the same table (in case there is no other column making a dimension table meaningful, in that case, you would better have a separate dimension table having ID as the primary key). Create a dimension from the m2m dimension table, and a measure group having only the invisible measure "count" from the bridge table. Finally, on the "Dimension Usage" tab of Cube Designer, set the relationship between the m2m dimension and the main measure group to be many to many via the bridge measure group.
See http://technet.microsoft.com/en-us/library/ms170463.aspx for a tutorial on many-to-many relationships.