Forum Discussion
Dynamic column calculation based on user selection
Hi All,
I would like to know if we can dynamically calculate column values in powerbi based on user selection
For example,
If user selects 1 from the selection filter, then my Result column should calculate as 'Col_A * 1'
whereas if user selects 0 from the selection filter, then my Result column should calculate as 'Col_A * 0'
Thanks in advance!
Hi, Kavitha10
Please check the below picture and the measure.
The sample pbix file's link is down below.
Result =SUMX('Table', 'Table'[COL_A] * SELECTEDVALUE('Switch'[Switch],1))Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
2 Replies
- Jihwan_KimSuper User
Hi, Kavitha10
Please check the below picture and the measure.
The sample pbix file's link is down below.
Result =SUMX('Table', 'Table'[COL_A] * SELECTEDVALUE('Switch'[Switch],1))Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
- Kavitha10Frequent Visitor
Awesome, it worked! Thanks much.