Preventing Editing of a Certain Value Using a DAX Measure
The Aimplan Planning & Reporting visual enables user to input values to their planning model. However, there may be cases where users need to prevent editing of a certain value. In this article, we will explore how to achieve this using a DAX measure.
In this example, we will prevent users from inputting data on other projects. This may be useful in scenarios where you want to see the big picture, even if you're only allowed to edit a single project.
- Open the Power BI report in Power BI Desktop so that we can access the modelling tools.
- Go to the "Data view" tab.
- Select the table in which you want to create the measure that will indicate the locked status.
- Click on "New measure" in the "Table tools" tab.
- In the textbox, which is presented, enter a measure that returns a boolean value.
In the example below, we are returning true if the data does not contain project 2000
Now that we have a measure that will return true if we should not be able to edit the value, we can use it in our visual.
- Go to the visualization tab and select the visual that you want to prevent edit in.
- Drag your new measure into "Values" so that it is available in the visual.
- Press the three dots in the top right corner and then press "Edit".
- Navigate to the measure that you want to control.
- Expand the "Editable" section and in the "Locked Indicator" dropdown, select the measure you dragged in.
Then if you press the "Preview" button, you should see that all cells for which the measure is true are locked, as indicated by the gray color.