'Is there a visual component for write a number directly through PBI in published report?
I would like to allow users to input a integer number to be used in some calculations.
I know that it is possible to use What-if parameters. However, What-if parameters can only be used with value ranges between 0 and 1,000. For the ranges greater than 1,000, the parameter value will be sampled.
For example, I can't write 8,529 because the number will be sampled to 8,521.
Maybe there is some hidden workaround or a custom visual component. I tested with Smart Filter by OKVIZ but it doesn't work in Power BI Service neither in an embedded application.
Thanks a lot!
--- Miguel-Angel
Solution 1:[1]
I used the Smart Filter Pro and it works.
Solution 2:[2]
the code that could make the button visible is only executed in the OnClickListenerof the button that you made disappear. So you need to include that in the other OnClickListeneras well. And since that would be the same code twice it's better to extract it to a separate fucntion, so like this for example:
var number = 1
mBinding.llNext.setOnClickListener {
number += 5
handleClick()
}
mBinding.llBack.setOnClickListener {
number -= 5
handleClick()
}
fun handleClick() {
if(number <= 0) {
mBinding.llBack.visibility = View.GONE
} else if (number >= 0) {
mBinding.llBack.visibility = View.VISIBLE
}
mBinding.tvCount.text = number.toString()
}
Bonus:
you could make the visibility check more compact like this:
mBinding.llBack.isVisible = number > 0
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 | Miguel Angel Oros Hernández |
| Solution 2 |
