Search code examples
powerbissasdaxcustom-data-attribute

how do you prevent the result of a formula from changing with the filters in SSAS?


First of all, I have a security CustomData() that is filtering data depending on IdCentre of the table Dim_Centre.

IdCentre | UserName
--------------------
7613     |  Jame_R
7610     | Hugo_T

On the other hand, I have a table Fact_Control that has the total controls made by each Center depending on the type (1,2).

Date_Ctl |IdCentre|Departement|Type_Ctl| Total_Ctl
20200201   7613      76           1        10
20200202   7613      76           2         5
20200202   7613      76           1         4
20200202   7610      76           1        10
20200202   7610      76           2         7
20200203   7610      76           2         3
20200203   7610      76           1         5

I need a formula that calculates the number of controls made per department. This formula cannot change depending on the center, as there are centers that do not work every day.

for example: Total_CTL_Dep = 44 If I filter by the center 7613 the total_Ctl_Dep change to 19 but I want to keep the 44.

Thanks in advance for your help


Solution

  • Is you just need a single number that is unfiltered by row level security then the easiest way to accomplish this is by creating a hidden calculated table. Calculated tables are calculated at processing time outside without row level security being applied. (You could put row level security over the resulting calculated table but in this instance you wouldn’t want to.) ensure the new Fact_Control_Dep calculated table has no relationships to other tables (so that row level security won’t filter its rows).

    Fact_Control_Dep = ROW("Total_CTL_Dep", SUM(Fact_Control[Total_Ctl]))