Forum Discussion
If function with a parameter value as as an input
Hello,
I added a parameter as a slicer :
Parameter Value = SelectedValue('Parameter'[Threshold])
Also I have a table (Table1) containing a type linked to an amount :
Table1
| Type | Date | Amount |
| A | 2018 | 233 |
| A | 2019 | 183 |
| A | 2020 | 75 |
| A | 2021 | 115 |
| A | 2022 | 114 |
| A | 2023 | 137 |
| B | 2018 | 160 |
| B | 2019 | 242 |
| B | 2020 | 75 |
| B | 2021 | 44 |
| B | 2022 | 33 |
| B | 2023 | 90 |
I would like to add in this table a new column 'Overshoot' meaning when the Amount is > Parameter Value then it's an overshoot else not.
For Example
If I select '80' in my parameter I would Have :
Table1
| Type | Date | Amount | Overshoot |
| A | 2018 | 233 | Y |
| A | 2019 | 183 | Y |
| A | 2020 | 75 | N |
| A | 2021 | 115 | Y |
| A | 2022 | 114 | Y |
| A | 2023 | 137 | Y |
| B | 2018 | 160 | Y |
| B | 2019 | 242 | Y |
| B | 2020 | 75 | N |
| B | 2021 | 44 | N |
| B | 2022 | 33 | N |
| B | 2023 | 90 | Y |
Overshoot = IF ('Table1'[Amount]> 'Parameter'[Parameter Value], "Y", "N")
But it doesn't work
Could you help me?
Thanks in advance,
- Anonymous3 years ago
Hi Anonymous
It is better to create a measure instead of a calculated column, the calculated column is a static value, it will not change with your slicer, a measure is a dynamical value, it will affected by your slicer, so you can refer to the following measure.
Overshoot = IF (SELECTEDVALUE('Table1'[Amount])>[Parameter Value], "Y", "N")Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi Anonymous
It is better to create a measure instead of a calculated column, the calculated column is a static value, it will not change with your slicer, a measure is a dynamical value, it will affected by your slicer, so you can refer to the following measure.
Overshoot = IF (SELECTEDVALUE('Table1'[Amount])>[Parameter Value], "Y", "N")Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.