Forum Discussion
Make a calculated column return different dimensions based on parameter selection
Hi,
I would like the user to be able to display either an abbreviated or full Review Type, based on a selection in a slicer they choose. The slicer is based on a parameter I made.
I tried making a calculated column but it's not working as intended. I was expecting [Review] to look for the string in the parameter options and then return a desired dimension. But it's only returning Blank as far as I can tell.
Thank you for your help!
I've uploaded sample PBIX and XLSX to dropbox:
Hi ExcelUser
Calculated columns aren't affected by slicers since they are calculated during refresh.
I replaced your calculated column with the following measure: (After re-reading your post, your code should work as a measure - NOT a calculated column. The calculated column in your pbix is missing the TRUE() line changing the meaning of the whole SWITCH() statement.)
Review = SWITCH( SELECTEDVALUE('PSI/PC-06 Review Details'[PSI/PC-06 Details]), "Aggregate Review Types", MIN( test_data[REVIEW TYPE] ), "Separate Review Types", MIN( test_data[Full Review Type] ) )Let me know if you have any questions.
7 Replies
- gmsambornSuper User
Hi ExcelUser
Calculated columns aren't affected by slicers since they are calculated during refresh.
I replaced your calculated column with the following measure: (After re-reading your post, your code should work as a measure - NOT a calculated column. The calculated column in your pbix is missing the TRUE() line changing the meaning of the whole SWITCH() statement.)
Review = SWITCH( SELECTEDVALUE('PSI/PC-06 Review Details'[PSI/PC-06 Details]), "Aggregate Review Types", MIN( test_data[REVIEW TYPE] ), "Separate Review Types", MIN( test_data[Full Review Type] ) )Let me know if you have any questions.