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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.