SSAS Tabular model: two relations with the same dimension table - ssas

I need to create a tabular model with ssas but in a fact table I have two relations with the same dimension (time).
How is it best to handle this?
Duplicating the dimensions table ?
Thanks

You don't need to duplicate the dimension table. You can create both relationships, setting one as INACTIVE. Once this relationship is set up you can invoke the inactive relationship using the USERELATIONSHIP function. This will essentially make the relationship ACTIVE for that measure.
The following links give a great explanation followed by some examples.
Link 1
Link 2

Thanks for your answer,
this model is going to be used by business user and the haven't deep knowledge of dax.
I can't develop all the measures several times (also because it is about 4 dates per table and about fifty measures).
Whant do you think about this:
https://www.biinsight.com/role-playing-dimension-ssas-tabular/#more-1068
Thanks

Related

Data Warehouse Architecture Modeling

I'm trying to Architecture creating a data warehouse in the Star Schema model... any idea would be appreciated.
Any idea what I should do to create a Star Schema? Some day that I should have a linking table with DimProjects going to the fact tables. What about Project hours? What is the right approach to this or do I need other tables to link? Employee's can work on multiple projects, projects require man hours... etc.
What is the best approach on modeling?
So far I have tables:
[CODE]
Dimension Tables Measure Tables
---------------- --------------
DimEmployee FactCRM
DimProjects FactTargets
DimSalesDetails FactRevenue
DimAccounts
DimTerritories
DimDate
DimTime
[/CODE]
Dimensions in a schema of a datewarehouse means independent entities like for say
Dim_Employee
Empid(pk)
Name
Address etc likewise all other
dimensions
With each dimension keys linked to your fact like in above case
FactCRM would include only crm
related measures and would be linled
To their specific dimensions depending
upon the requirements
Without knowing the columns noone would be able to tell what you want in actual. Also remember linking a dimension to a fact is obviously a partial star schema itself so that doesnt lead to any issues. The only thing is if your dimensions are itself normalized in a schema then it becomes snowflake.
Another thing about fact related if you want to perform manipulation of othwr facts based on somw existing facts then you have to link fact table as well with a unique factid. This is called fact constellation. Then the schema would become star/snowflake schema with facy constellation

Adding related dimensions to a SSAS Cube

Hello there and thank for taking your time to read this. This is a very trivial question, however, it is a bit challenging to me. I am trying to add a related dimension in an existing cube and have been unsuccessful so far. I have gone through a few tutorials, but nowhere this concept is covered. I am very new to SSAS, Data Warehousing and SQL server so please bear with my ignorance.
I have documented the steps taken, https://1drv.ms/b/s!AugVuOwqQy9XiFoE2BFR5omxFXAZ?e=Zytp3y
If any additional information, please let me know. Any help is appreciated.
Thank You - KK (filesincloud#outlook.com)
You seem to want to define a Snowflake schema.
You can read about it here
Information from multiple tables is required to define the dimension. Each dimension is based on attributes from columns in multiple tables linked to each other and ultimately to the fact table by primary key - foreign key relationships.
For the Dimension table to Dimension table relationship, you need to use the Referenced Relationship
In simple terms, you need a set a relationship type. The below shows the different relationship types:
If you have the AdventureWorks sample, you can see the following Reference relationship defined:
You can now look at your dimension reference relationship and change it.
Good luck !

SSAS Tabular View

I am in the process of building my first tabular view and have a question.
The tabular model I have has 3 tables based on 3 views that exist on SQL server. An incident view, a users view and a category view.
On the incident view, I have 2 columns (AssignedUser,CreatedUser) which both can be linked to the users view based on user ID, however I have been told only one relationship between tables can be active at one time? If this is the case how would I link both assigned and created user back to the user table?
Sorry if it's simple to answer, I couldn't find anything helpful on google and I have tried!
Many thanks
If you need to join 2 times (or more) your Dimension User, you could duplicate your existing view.
for example:
Your DimUser view will be DimUserInCharge (Or DimSupportTeam, ..) and DimEndUser (or DimClient, ..)
Here is a small exeample based on Adventure Works DB
If you want to keep the same dimension, you will have to design your Fact in a different way. (And maybe add another dimension like "DimUserType")
or Add 2 differents Fact table
...
Does it help you?
Arnaud

relationship between 2 fact tables in dimension usage - SSAS

I have 2 fact tables. One is being used as a dimension - Bridge table for multi valued Dimensions. The other is FactSales. What I am trying to achieve is to get a count of customers from sales table where they have a specific member property (comes from the other Fact Table). I thought making the relationship between the two is the way ahead.
I tried using the PersonID as the join in Dimension Usage tab, trying both regular and References (using DimPerson) but it didn't work. Does anyone know why this might be? Or what is the way around this?

Database layout/design inefficient

The image shows my proposed layout for part of a database. My concern is with the price bands and the way these attach to [shows] and [bookings]. There needs to be a list of price bands (as in titles) but the same band can have multiple values depending on which show it is attached to (a standard ticket for Friday could be £10 where as a standard ticket on Saturday could be £11).
It just seems to me with this approach them will be a lot of almost identical data - lots of entries for £5 tickets in [showpriceband] with the only difference being the showid.
Is there a better approach to this?
I think that your approach is correct. You have
different ticket types
different shows
And their relation is n:n. The correct solution for resolving a n:n relation is a separate table (in your case ShowPriceBand) to enlist all the combinations.
Regarding this issue:
It just seems to me with this approach them will be a lot of almost
identical data - lots of entries for £5 tickets in [showpriceband]
with the only difference being the showid.
You can avoid this duplication with adding a join table between show and showpriceband tables. I don't think it would be really natural, but it depends on your data. (and probably you should rename showpriceband also...)
Or maybe you can consider moving the fields from showpriceband to priceband. (value, ongeneralsale) sausing a bit more redundancy there, but making the showpriceband table more connecting table like.
As the relationship between Show and PriceBand is many-to-many, it is a standard approach to define an intermediary table to define this relationship. In your case, apart from the linking columns (foreign keys to Show and PriceBand) you defined additional properties of the link.
This is a valid approach and there is no need to reduce possible duplication of those additional fields.