Forum Discussion
Replace data labels in graphs? Or replace column values triggered by a table list?
Refer, if this can help : https://www.biinsight.com/power-bi-desktop-query-parameters-part2-dynamic-data-masking-and-query-parameters/
I tried the code on the suggested site in the Query Editor, however it seems the code perhaps should be used elsewhere as I don't get it to work. I get '='-sign expected on the first row using:
ALTER TABLE Table_Name ALTER COLUMN Column_Name1 ADD MASKED WITH (FUNCTION = ‘Mask_Function’);
The base data is coming from an Excel-file. Not sure if the source needs to be an SQL-server for it to function.
Ideas anyone?
From the home page:
Alter an existing table and enable DDM on desired columns
As you guessed you have to use “ALTER TABLE” then “ALTER COLUMN”. Your T-SQL should look like:
ALTER TABLE Table_Name ALTER COLUMN Column_Name1 ADD MASKED WITH (FUNCTION = ‘Mask_Function’);
GO
ALTER TABLE Table_Name
ALTER COLUMN Column_Name2 ADD MASKED WITH (FUNCTION = ‘Mask_Function’);
GO