Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Kavitha10
Frequent Visitor

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'

Kavitha10_0-1618905201937.pngKavitha10_3-1618905313313.png

whereas if user selects 0 from the selection filter, then my Result column should calculate as 'Col_A * 0'

Kavitha10_4-1618905340974.pngKavitha10_5-1618905370669.png

Thanks in advance!

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi, @Kavitha10 

Please check the below picture and the measure.

The sample pbix file's link is down below.

 

Picture5.png

 

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.


Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, @Kavitha10 

Please check the below picture and the measure.

The sample pbix file's link is down below.

 

Picture5.png

 

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.


Linkedin: https://www.linkedin.com/in/jihwankim1975/

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Awesome, it worked! Thanks much.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.