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

Book Review: Unlocking the Power of DAX: A Deep Dive into Marco Russo’s Definitive Guide

The Definitive Guide to DAX: Business intelligence for Microsoft Power BI, SQL Server Analysis Services, …

Geef een reactie

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