Forum Discussion

mmmm's avatar
mmmm
Frequent Visitor
6 years ago

Understanding of Countrows function within calculate in security implementation and ranking

Hi,

I have just seen the security implementation on SSAS tabular Project which is my existing project. There are 2 main tables for implementing Security.

  • DimUserPermission which has Username Column and  1 other Column lets say Country. So there are 2 Columns(Username, Country). 
  • DimSecurity also has 2 columns Security id incremental Column and Country.

Fact table also have Security id

 

On SSMS tabular Instance under the role, there is a tab Row Filter.

there is 2 Dax Query. On Table DimUserPermission:-

DimUserPermission[UserName] = UserName()

On Table DimSecurity:-

Calculate
   (
   countrows(DimUserPermition ),
   DimUserPermission[UserName]=UserName()
   )>=1

I would like to know what is the result of this Query 

 

Calculate ( countrows(DimUserPermition ), DimUserPermission[UserName]=UserName() )>=1

 

If it is only used to validate the result, Then How the filters are passed in fact table. Because DimUserPermission has 1 to many relationships with Dimsecurity. Dimsecurity is 1 too many relationships with fact.

almost the same problem for the Code mention in the screenshot. 

 

 

the above code in the screenshot is Dynamic Grouping With Additional Ranking Logic. In this Logic, CountRows function only validates the result. How the Countrows function returns rows to filter function.

2 Replies

    • mmmm's avatar
      mmmm
      Frequent Visitor

      Hi, 

      Everything is working. As I mentioned in my Question above there is 2 logic both are work Correctly.
      I have the problem to understand how it works. There are 2 parts of logic in which I have confusion.

       

      1.in the security implementation part how the data is passed from DimSecurity Table to fact table because the below Code only validate gives true and false.

      the code 

      Calculate
         (
         countrows(DimUserPermition ),
         DimUserPermission[UserName]=UserName()
         )>=1

       2. Same problem in ranking How Countrows function delivers the filter rows for filter Function.