Forum Discussion
Problem with data model and establishing relationship after unpivoting columns
Hi, Maciek_ ;
Could you please consdier sharing a simple file after removing sensitive information and posting expected result so it is clear ?
It makes it easier to give you a solution.
Best Regards,
Community Support Team_ Yalan Wu
Hi v-yalanwu-msft ,
Sure, Please check the file here
lbendlin, I am aware of star schema but I cannot see a possibility of establishing correct relationship between "Append" and "Dep details" tables after I unpivot data in "Append" table (I do this so I could represent data in a matrix consisting of two columns). Different activities in Dep details can include the same Environments and Lversions which means there is no unique column I can use for 1:* relationship. Of course *:* relationship between these two tables return incorrect data in my visual - sometimes one column is missing, sometimes both and sometimes the values for different env.ID or Lversion.ID are displayed.
Best regards,
Maciej
- v-yalanwu-msft4 years ago
Community Support
Hi, Maciek_ ;
You could create a measure as follows:
Measure = CALCULATE(MAX([Value]),FILTER(ALL('Append and unpivot - Lversion + Env'),[Type]=MAX([Type])&&[Value]=MAX([Value])))
The final output is shown below:If not ,can you share me the result what you want to output?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Maciek_4 years agoFrequent Visitor
Hi again v-yalanwu-msft I am afraid that is not at all what I need 😞 the expected output is shown on one of the screenshots above and also here again
In small table I should see the details of the activities based on the selection (filtering) from bigger table - if I select a row in a bigger one, the small one should display attributes taken from Env details table based on selected "Env.ID" in the first column and attributes taken from Lversion details table based on selected "Lversion.ID" in the second column.
lbendlin I tried using Dep details table as a fact table as well but for both this table and Env details table Lversion.ID can be repeated so relationship between these cannot be other than many to many...- lbendlin4 years ago
Super User
You can get away with Many-to-Many relationships as long as you use a single filter direction.
- lbendlin4 years ago
Super User
If you consider both "Append" and "Dep Details" to be fact tables then that is fine - just don't try to link them directly. Link them via common dimensions, and then use the dimension fields for the visual filters.