'Calculated column based on What-if parameter

I have a table visual in PowerBI that summarizes work hours by employee. The first column shows the employee name.

When training managers on how to use it I want to anonymize by showing employee numbers instead of names.

I tried adding a what-if parameter Anonymous with values 0 and 1 and use IF() in the DAX of a calculated column but it is not working. It ignores the parameter value.

Person = IF(Anonym[Anonym value] = 0; Time[Name]; Time[Empno])

will always show Name.

Person = IF(Anonym[Anonym value] = 1; Time[Name]; Time[Empno])

will always show Empno.



Solution 1:[1]

Another option if you really need to use a column and needs it to be "dynamic" is to use a PowerQuery parameter and add a new column based on it and then create your conditional. The downside of this is that you will have to refresh your query everytime you want to change the parameter

Solution 2:[2]

When talking about complexity, we usually assume the input is an array of numbers which have constant size. Then the size of the input is proportional to the number of elements in the array.

However, when this is not the case, you have to agree on what you mean by "input size". There are several possibilities, the number of bits being an important one. Another definition which is used sometimes, is the sum of the input values (or the only input value). Also called "unary representation".

If you have one input, and it has constant size, complexity is meaningless. In this case, it could be either 8 or 32 bits — in any case, there is no complexity here at all.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hugobdo
Solution 2 anatolyg