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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rbiswas
Frequent Visitor

Return the selection of slicer/fliter to use it for calculation/

Hi All,

 

Suppose i have a Column named as "country and another column "Sales value". For all the country, i have "Sales values" in Dollar.

 

I want that if i apply a filter for a specific country, it should shows the "Sales value" in terms of the local currency by applying appropriate exchange rate. 

 

But, when nothing is selected in the filter, the net "Sales Values" i.e in global level should be shown in "Dollar.

 

Right now the problem is I made a column "Sales Value Local Curr"=Sales Value*Exchange rate. When filter is applied, the output shows the net value as needed. But, if nothing is selected, then it simply summed up all the values, which is wrong since the values correspond to different currency for different country.

 

Capture.PNG

 

 

1 ACCEPTED SOLUTION

Hi @rbiswas

 

Supposing your table is named 'Sales'

Try this measure:

 

[Total Sales] = IF( Hasonevalue('Sales'[Country]) , Sum('Sales'[SalesValues(Local)]) , Sum('Sales'[SalesValues(Dollar)]) ) 

View solution in original post

2 REPLIES 2

Hi @rbiswas

 

Supposing your table is named 'Sales'

Try this measure:

 

[Total Sales] = IF( Hasonevalue('Sales'[Country]) , Sum('Sales'[SalesValues(Local)]) , Sum('Sales'[SalesValues(Dollar)]) ) 

Thanks for the solution, it works 

 

One more question, is it posssible to return the selection data from the filter, since initially we were planning to implement the same using the data selected in filter

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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