Forum Discussion

CRCPowerBI's avatar
CRCPowerBI
Frequent Visitor
5 years ago

Single Direction Relationship and Slicer for Two Tables, Issue with Aggregation

I am creating a visualization that allows for individuals to compare headcount in their assigned division to that of the entire institution. They will login, and based on their user information, the data will be filtered with row-wise security.

 

Because I want an individual to be able to compare their data to the institution, I have created two data tables - one where row-wise security is applied (Table 1) and another where it is not (Table 2; for institution calculations). Each has the exact same data in it but one is filtered down to the individual's data. I'm using race/ethnicity as a grouping variable, and it's very important to see when these values are zero. For this reason, I created a dim/reference table for all the race/ethnicity categories and created a single direction relationship to both tables, e.g.:

 

Table 1 <--- Dim Table ---> Table 2

 

For visual simplicity, I've created a table visualisation that has four columns: DimTable[Race], Individual Headcount (Table 1), Individual Headcount %(Table 1), Institution Headcount (Table 2), Institution Headcount % (Table 2), e.g:

 

DimTable[RaceEthnicity]Individual Headcount (Table 1)Individual Headcount % (Table 1(Institution Headcount (Table 2)Institution Headcount % (Table 2)
Group 11010%15025%
Group 22030%50031%

 

This appears to work pretty well with one exception. When the value is not present in Table 1 (the one with row-wise security), the rows are returned as blank for the Table 2 calculations. These values are definitely not zero for the institution. 

 

DimTable[RaceEthnicity]Individual Headcount (Table 1)Individual Headcount % (Table 1)Institution Headcount (Table 2)Institution Headcount % (Table 2)
Group 1101015025
Group 200.0  

 

Is this particular visualization possible given the way I've setup my tables/relationships? I'm very new to Power BI, so this is not how I expected a single direction relationship to function in this situation. Perhaps I'm missing something completely obvious, or perhaps this particular setup is not possible.

 

1 Reply

  • Instead of using two fact tables you will want to use two dimension tables - one with RLS and one without. RLS should not be directly applied to fact tables, it should flow from the data model.