Forum Discussion
RLS And USERELATIONSHIP
- Anonymous2 years ago
HI Anonymous,
I mean you can extract the corresponding item list from the target table without active fact relationship. Then you can use this list as condition in your Dax expression to filter calculation records.
formula = VAR IDlist = CALCULATETABLE ( VALUES ( 'DWH Dim_Neighborhoods'[NeighborhoodID] ), ALLSELECTED ( 'DWH Dim_Neighborhoods' ), VALUES ( 'DWH Dim_Neighborhoods'[NeighberhoodNameHEB] ) ) RETURN CALCULATE ( SUM ( 'DWH Fact_ImigrationInCity'[Quantity] ), FILTER ( ALLSELECTED ( 'DWH Fact_ImigrationInCity' ), 'DWH Fact_ImigrationInCity'[NeigheberhoodTargetID] IN IDlist ) )Regards,
Xiaoxin Sheng
- Anonymous2 years ago
Thank you!
formula =VAR IDlist =CALCULATETABLE (VALUES ( 'DWH Dim_Neighborhoods'[NeighborhoodID] ),ALL ( 'DWH Dim_Neighborhoods'[NeighberhoodNameENG] ))RETURNCALCULATE (SUM ( 'DWH Fact_ImigrationInCity'[Quantity] ),FILTER (ALLEXCEPT( 'DWH Fact_ImigrationInCity','DWH Dim_Date'),'DWH Fact_ImigrationInCity'[NeigheberhoodTargetID] IN IDlist))I made some changes and now it work, Thanks again!!
HI Anonymous,
Perhaps you can try to extract the value from other table and manually apply in expression calculations instead of use relationship functions. They should not affect the RLS usages.
Regards,
Xiaoxin Sheng
Thanks for your cooment.
I tried this DAX code:
#test = CALCULATE( sum('DWH Fact_ImigrationInCity'[Quantity]), FILTER( 'DWH Fact_ImigrationInCity', 'DWH Fact_ImigrationInCity'[NeigheberhoodTargetID] = CALCULATE( MAX('DWH Dim_Neighborhoods'[NeighborhoodID]), 'DWH Dim_Neighborhoods'[NeighberhoodNameHEB] = SELECTEDVALUE('DWH Dim_Neighborhoods'[NeighberhoodNameHEB])) ),ALL('DWH Fact_ImigrationInCity') )
thats what you mean?
it doesnt works for me.