Creating Relationships while avoiding ambiguities

丶灬走出姿态 提交于 2020-01-07 08:21:04

问题


I have a flat table like this,

R#  Cat SWN CWN CompBy  ReqBy   Department
1   A   1   1   Team A  Team B  Department 1
2   A   1   3   Team A  Team B  Department 1
3   B   1   3   Team A  Team B  Department 1
4   B   2   3   Team A  Team C  Department 1
5   B   2   3   Team D  Team C  Department 2
6   C   2   2   Team D  Team C  Department 2

R# indicates the RequestNumber, Cat# indicates the Category, SWN indicates the Submitted Week Number, CWN indicates the Completed Week Number, CompBy indicates Completed By, ReqBy Indicates Requested By, Department Indicates Department Name,

I would like to create a data model that avoids ambiguity and at the same time allows me to report on Category, SWN, CWN (needs to be only a week number), CompBY, ReqBy, Department through a single filter.

For example, the dashboard will have a single filter choice to select a week number.If that week number is selected, it will show the details of these requests from submitted and completed week number. I understand this requires the creation of a calendar table or something like that.

I am looking for a data-model that explains the cardinality and direction(Single or both). If possible, kindly post the PBIX file and repost the link here.

What I have tried: Not able to establish one of the four connections

Update: Providing a bounty for this question because I would like to see how does the Star schema will look like for this flat table.

One of the reason I am looking for a star schema over a flat table is - For example, a restaurant menu is a dimension and the purchased food is a fact. If you combined these into one table, how would you identify which food has never been ordered? For that matter, prior to your first order, how would you identify what food was available on the menu?


回答1:


The scope of your question is rather unclear, so I'm just addressing this part of the post:

the dashboard will have a single filter choice to select a week number. If that week number is selected, it will show the details of these requests from submitted and completed week number.


One way to get OR logic is to use a disconnected parameter table and write your measures using the parameters selected. For example, consider this schema:

If you put WN on a slicer, then you can write a measure to filter the table based on the number selected.

WN Filter = IF(COUNTROWS(
                INTERSECT(
                    VALUES(WeekDimension[WN]),
                    UNION(
                        VALUES(MasterTable[SWN]),
                        VALUES(MasterTable[CWN])))) > 0, 1, 0)

Then if you use that measure as a visual level filter, you can see all the records that correspond to your WN selection.


If you can clarify your question to more closely approach a mcve, then you'll likely get better responses. I can't quite determine the specific idea you're having trouble with.



来源:https://stackoverflow.com/questions/51769762/creating-relationships-while-avoiding-ambiguities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!