Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
The link below is to a .pbix file with a single matrix visualization that includes a Measure (PctDiff) that computes the percentage difference between an Actual Value and a Target Value. I have another Measure (Comparison) that returns True if PctDiff is greater than or equal to 0.25 (25%), and otherwise returns False.
UserControlledVariableInMeasure.pbix
Rather than hard-coding the percentage on which this comparison is based at 25%, I'd like to give the user of my report the ability to choose this percentage.
My Comparison measure is currently defined as follows:
Solved! Go to Solution.
File didn't open for me
I create a table, and named the column Percentages.
Percentage = GENERATESERIES(0, 100, 1)
And a measure
Target =
var percentage = SELECTEDVALUE( Percentage[Percentages] ) / 100
RETURN
SUM( 'Table'[Value] ) * percentage
Add a slicer for the user to select from and add the measure a table.
Thank you @Deku - I just updated to the Feb 2025 release, and I still don't have the Single Value option.
I think that is a different question than my original post. I will accept your solution for this one and post another question about the Single Value thing.
I appreciate your help!
Best regards,
Paul
Thank you @Deku - I now realize that my problem was how I configured my slicer. Rather than selecting a single value, I had it selecting a range of values. The Style options I see are the following...
With this set to Dropdown, I am able to select a single value as shown below, and my Comparison logic works as you suggested it would...
I like what you did in your example better. It looked like a single entry field (labeled Percentages) below with a cicular control on a horizontal line that you can drag to change the value...
Would you mind telling me the Slider settings you used to accomplish this?
I appreciate your help.
Best regards,
Paul
Single Value
Not sure why you can't see it. I am using Feb-25 release of Power BI
You need to have a list of values you'd allow to be selected in a table.
For percentage this could be generated with
Percentages =
Generateseries(0,100,1)
This would be added a slicer to the report and you could pick it up in your measures with
Selectedvalue( percentages[value] ) / 100
Thank you @Deku - that sounds like a great approach, but I must be doing something wrong.
In the updated file at the link below, I created a calculated table named Percentages as you suggested, and I added a slider that allows the me to select a value from this table. I changed my Comparison measure to reference SELECTEDVALUE(Percentages[Value])/100 instead of the hard-coded value 0.25, but the value I select in the slider does not seem to have an effect on the the results of my Comparison, which always returns True now. As a test, I added a measure named PercentSelected defined as follows:
File didn't open for me
I create a table, and named the column Percentages.
Percentage = GENERATESERIES(0, 100, 1)
And a measure
Target =
var percentage = SELECTEDVALUE( Percentage[Percentages] ) / 100
RETURN
SUM( 'Table'[Value] ) * percentage
Add a slicer for the user to select from and add the measure a table.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 38 | |
| 31 | |
| 30 |