Custom Filter to toggle between values in a table measure

I have a table which has a column called Revenue which is sum(revenue). I want to create a custom filter which will let users toggle between Revenue (in USD) and Revenue (in local currency) where Revenue(in local currency) is sum(revenue) * fx_rate.
The filter will not filter the dataset but will allow the users to switch to another value of the same measure.

@souradeepd I would refer you to this post to get started : Can I use list of attributes in filter

That should give you the foundational concepts to create a custom filter which allows the user to toggle between different measures.

@shaun its the same set of measures which will appear in the table, but based on the filter selection it will be displayed in US Dollar or Other currencies. the underlying data is all in USD, but if user selects Other Currencies it will multiply the measure (in USD) with another measure (exchange_rate), but if USD is selected in the filter, it will display just sum(revenue)

@souradeepd the same concept still applies. You will have to use parameters in custom expressions as outlined in the earlier post.

Filter configurations

Create your custom filter with the two selections you want:

  1. US Currency
  2. Local Currency

Configure the settings to Enable only single select without an “All” option:

Visual configuration

In the measure shelf you want to use the custom expression with parameter syntax such as this:

<<currency_selection>> as '<<currency_selection.alias>>'

Then you can start making selection from the filter to update the visual measure:

Thanks Shaun. This is helpful.

Is there a way to do this one time for 10 measures (Sales, Revenue, Cost…etc) without creating 20(10*2) filter selections?
So ideally, the selection will apply to all numerical measures in the table based on the filter selection?

@souradeepd if you want to selectively choose local vs US currency for each of the 10 column then you would need one filter selection per measure.

However, if you want to toggle between local vs US currency for all the measures – ie all the measures (sales, revenue, cost, etc…) appear all either as local or US currency, – you could use single filter selection.

In the custom filter, I would configure the values as follows:

US currency is essentially a “no-op” while the Local currency specifies the fx_rate.

Then in the visual I would change the expression to something like this:

sum([Sales]*<<currency_selection>>) as 'Sales <<currency_selection.alias>>'

You can then use this expression as template for all the other column measure.

@shaun thanks a lot!