Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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

TypeDateAmount
A2018233
A2019183
A202075
A2021115
A2022114
A2023137
B2018160
B2019242
B202075
B202144
B202233
B202390

 

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

TypeDateAmountOvershoot
A2018233Y
A2019183Y
A202075N
A2021115Y
A2022114Y
A2023137Y
B2018160Y
B2019242Y
B202075N
B202144N
B202233N
B202390Y

 

 

 

Overshoot = IF ('Table1'[Amount]> 'Parameter'[Parameter Value], "Y", "N")

 

 

But it doesn't work

Could you help me?

Thanks in advance,

 

  • Anonymous's avatar
    Anonymous
    3 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

  • Anonymous's avatar
    Anonymous
    Not 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.