Home / T-SQL / DAX Set column to Zero based on Username()

DAX Set column to Zero based on Username()

I was looking for a formule to reset a column in my tabular model to zero based on the user who is logged in. This is quick workaround. In SSAS Tabular 2016, it’s impossible to hide columns. We are used to a dimensional model. We had to find a quick fix.

After trial and error, I found a formula. The trick is to check the user who is using the Tabular model. When the user is in my hard-coded list (check USERNAME() ), we do a * 1, otherwise we do a * 0.

DAX Formula:

Marge Reeel Totaal:=
SUMX(
DeclaratieRegel;
DeclaratieRegel[_Marge Reeel Totaal] *
SWITCH(
USERNAME();
“NL0007892”; 1;
“NL0007444”; 1;

0
)
)

Check Also

T-TSQL – Create 4 week Moving Total

This article will offer you a way to calculate a 4 week moving total in …

Geef een reactie

Het e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *