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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Aabhishek
Regular Visitor

change column based on filter

Hi Everyone,

 

I am trying to write a measure which changes the column used for calculation based on filter selection. 

 

Example: If the selected filter value is A, measure should calculate using column 1, if selected filter value is B, then the measure should calculate using column 2, if nothing is selected, it should calulate using column 3.

 

How do I write this measure?

 

Or I am looking it in a wrong way and need to modify the data model? 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Aabhishek,

 

You may use SELECTEDVALUE Function inside SWITCH Function to add a measure.

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@Aabhishek,

 

You may use SELECTEDVALUE Function inside SWITCH Function to add a measure.

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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