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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Tanisha10
New Member

Power BI does not support selecting between two columns at row level inside a measure

Hi All,

Based on the Industry Code Type selection, Industry code should switch between 2 columns and display the filtered records.

Tanisha10_0-1747298065228.png

I have a slicer table like below:

Industry Code Type = DATATABLE("Values", STRING, {{"NAICS"}, {"SIC"}})

Created a measure:

Industry Code =
SWITCH (SELECTEDVALUE('Industry Code Type'[Values]),    
"SIC",  'Account'[Account_SIC_Code],    
"NAICS", 'Account'[Account_NAICS Code])

I just wanted to display filtered SIC/NAICS code values in the second slicer based on the selection in the first slicer.
But as per my knowledge, 
>Measures are evaluated at runtime, but cannot be used to dynamically switch between columns per row. Power BI does not support selecting between two columns at row level inside a measure. 
>Calculated columns are evaluated at data refresh, not interactively.
>Slicers are filters applied at visual level, not to control formula logic inside columns.


Is there a way to switch between 2 columns inside a slicer filter? 

 

Best Regards,

Tanisha

1 ACCEPTED SOLUTION
v-sdhruv
Community Support
Community Support

Hi @Tanisha10 ,

Power BI does not support row-level dynamic column switching inside a measure or calculated column based on slicer selection because of how the data model is evaluated:

Calculated columns are evaluated at refresh time, not during report interaction.

Measures are dynamic but cannot return column values per row — only aggregations (like max, Sum, etc.).

Slicers filter data but cannot control what column is used row-by-row in a visual.
But you can try using field Parameters.

Power BI now supports Field Parameters, which is the right way to dynamically switch between columns in slicers or visuals interactively at runtime.

  1. Enable Field Parameters:

    • Go to Modeling > New Parameter > Fields.

  2. Create a Field Parameter with SIC and NAICS columns:

    • Name it: Industry Control field

    • Add:

      • 'Account'[Account_SIC]

      • 'Account'[Account NAICS]

Hope this helps!
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!

View solution in original post

6 REPLIES 6
v-sdhruv
Community Support
Community Support

Hi @Tanisha10 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You

v-sdhruv
Community Support
Community Support

Hi @Tanisha10 ,
Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You

v-sdhruv
Community Support
Community Support

Just wanted to check if you had the opportunity to review the suggestions provided?
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You

v-sdhruv
Community Support
Community Support

Hi @Tanisha10 ,

Power BI does not support row-level dynamic column switching inside a measure or calculated column based on slicer selection because of how the data model is evaluated:

Calculated columns are evaluated at refresh time, not during report interaction.

Measures are dynamic but cannot return column values per row — only aggregations (like max, Sum, etc.).

Slicers filter data but cannot control what column is used row-by-row in a visual.
But you can try using field Parameters.

Power BI now supports Field Parameters, which is the right way to dynamically switch between columns in slicers or visuals interactively at runtime.

  1. Enable Field Parameters:

    • Go to Modeling > New Parameter > Fields.

  2. Create a Field Parameter with SIC and NAICS columns:

    • Name it: Industry Control field

    • Add:

      • 'Account'[Account_SIC]

      • 'Account'[Account NAICS]

Hope this helps!
If the response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!

bhanu_gautam
Super User
Super User

@Tanisha10 Add a calculated column in your 'Account' table that combines both SIC and NAICS codes into a single column based on the selection:

DAX
Combined_Industry_Code =
IF (
SELECTEDVALUE('Industry Code Type'[Values]) = "SIC",
'Account'[Account_SIC_Code],
'Account'[Account_NAICS_Code]
)

 

Create a measure to display the selected industry code based on the slicer selection:

DAX
Selected_Industry_Code =
SWITCH (
SELECTEDVALUE('Industry Code Type'[Values]),
"SIC", MAX('Account'[Account_SIC_Code]),
"NAICS", MAX('Account'[Account_NAICS_Code])
)

 

Use the Selected_Industry_Code measure in your visuals to dynamically display the filtered SIC/NAICS code values based on the slicer selection.

Add a slicer to your report using the Combined_Industry_Code column. This slicer will dynamically update based on the selection in the Industry Code Type slicer.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Hi @bhanu_gautam , Thank you so much for your quick response.
I also tried out adding a calculated column in 'Account' table earlier that combines both SIC and NAICS codes into a single column based on the selection using the same DAX that you mentioned. But it stores only values of the first Type i.e. NAICS code (by default), not the other one (SIC code). Basically Calculated columns can not be evaluated on the fly , it is always at data refresh time.

DAX:
Combined_Industry_Code =
IF (
SELECTEDVALUE('Industry Code Type'[Values]) = "SIC",
'Account'[Account_SIC_Code],
'Account'[Account_NAICS_Code]
)

 

Thanks,

Tanisha

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.