Forum Discussion
Toggle between absolute values and % - using field parameters
- 1 year ago
Hi Mariollo,
I'm attaching a pbix file with my solution.
If you have access to the model you could create a static table via 'Enter Data'.
Lets call the table 'Display Mask'
Add a column and name it 'Display'
Add a value 'Absolute'
Add another value '%'
Save and exit power query to apply the changes.
You should have 2 measures already created (if not you should do this first)
1 measure will hold the Absolute value
the other measure in %
You will then create a new measure, lets call it 'User Preference' and define it as below.
User Preference =
VAR _SelectedDisplay = SELECTEDVALUE('Display Mask'[Display],"Absolute") (Default selection will be abs if nothing selected)
VAR _Abs = [Absolute Value]
VAR _% = [% Value]
RETURN
SWITCH(
TRUE(),
_SelectedDisplay = "Absolute", _Abs,
_SelectedDisplay = "%", _%
)
N.B Be sure to drop the column from your new table into your report as a slicer