For this first create a parameter with default value.
After that create a filter and then write calculated filed with ifelse like this:
ifelse ( $parameter = ‘By Number of units’, filed1 , Field2 )
Make sure to use exact string in calculated field and in filter.
Did this solution work for you? I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!