Forum Discussion

Data-Crunch's avatar
Data-Crunch
Icon for Helper I rankHelper I
2 years ago

Switching Local and Corporate Currencies

Hi community

 

I have a report of multiple entities and various local currencies. The requirement is that a user can easily switch between the corporate currency (CHF) and their local currency.

As a result I need to check whether the selected companies all share the same local currency or if only one company is selected. If true, I show buttons that enable that switch and all measures used in the tables will use the button value to calculate either on local or coporate currency (I have a column for each in the tables). I used one measure to centralize that logic:

LC / CHF Logic = 

VAR _Logic=
SWITCH(TRUE(),
CALCULATE(DISTINCTCOUNT(Dim_Entities[Reporting  currency]),ALLSELECTED(Dim_Entities))>1,"CHF",
DISTINCTCOUNT(Actuals[Reporting  currency])>1,"CHF",
SELECTEDVALUE('LC / CHF'[Selection])="CHF","CHF",
SELECTEDVALUE('LC / CHF'[Selection])="Local Currency", "LC",
"CHF")

RETURN
_Logic

And I have a seperate measure that controls the visibility of the buttons:

LC / CHF Slicer Disable = 
IF(CALCULATE(DISTINCTCOUNT(Dim_Entities[Reporting  currency]),ALLSELECTED(Dim_Entities))=1,1,0)

 

Now the challenge:
When I have a matrix of all entities on a report page, obviously the standard behaviour is to show corporate currency. as shown below:

 

Also, when I filter the page using a slicer to one entity, or multiple that share the same currency, the buttons should show, as expected. See below:

 

HOWEVER, when a user does not filter with the slicer, but instead clicks into the matrix itself, the buttons still show. Yet, only clicking should 1. Not enable the user to change to Local Currency, and 2. the buttons to do so should not show....

The Measure with the logic reflects it correctly, it stops the conversion, but the button still shows....

How can I achieve that? I essentially want to show the buttons when there is a filter from the slicer (since the matrix only contains companies with the same currency) but I want to hide it, when a user simply clicks on one entity name....

Anyone have an idea?

Thanks a lot for the help! Really looking forward to the inputs since this has been bugging me for a while 🙂

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Data-Crunch 

    Can you please provide more details with your desired output and pbix file without privacy information (or some sample data)

     

    Best Regards

    Yongkang Hua