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();
“NL\00007892”; 1;
“NL\00007444”; 1;

0
)
)

Check Also

Ontgrendel de Kracht van Klantgegevens met een Postcodetabel: Uw Gids voor Succesvolle Data-analyse

Wat is een Postcodetabel? Een postcodetabel is in wezen een database van alle postcodes in …

Geef een reactie

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