Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Currency Slicer conversion

I have a report with columns:

Customer

Sales Value

Currency (in GBP, EUR and USD)

 

I am trying to create a slicer that will allow me to convert the Sales Value into any one of half a dozen Currencies (including the 3 above).

 

I have created a Currency Table with columns Currency and Currency Rate and populated it with the 6 rows I need.  I have then created a measure - 'Select Currency = VALUES(Currency[Currency]).  But when I try and drag the Measure onto the Dashboard it tells me 'A tables of multiple values was supplied where a single value was expected'.  I know I am missing something obvious, but I don't know what it is.

 

Can somebody point out where I am going wrong?

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    Could you tell me if my post helps you a little? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.Hope to hear from you‌‌

     

    Best Regards,
    Eyelyn Qin

6 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous VALUES returns a table and you can't return a table in a measure. You could use that expression in a VAR within the measure.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Greg_Deckler  What would that measure look like? Apologies, I am still a bit of novice in that respect.

    • Greg_Deckler's avatar
      Greg_Deckler
      Icon for Community Champion rankCommunity Champion

      Anonymous I'm not sure what you are trying to achieve. If you are trying to get the selected currency, then you would use:

      Selected Currency = MAX('Currency'[Currency])
      
      or
      
      Selected Currency = SELECTEDVALUE('Currency'[Currency])

       

      If you could provide some sample data and expected output could probably be of more assistance. Sorry, having trouble following, can you post sample data as text and expected output?
      Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

      Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

      The most important parts are:
      1. Sample data as text, use the table tool in the editing bar
      2. Expected output from sample data
      3. Explanation in words of how to get from 1. to 2.

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Greg,

         

        This is what I am working with at the moment:

         

        At the moment I have a table with sales in different currencies, I want to be able to pick the option in the slicer to convert everything to the same currency.

         

        I have a table with Currency and Rate, with Measure using SELECTEDVALUE, the last bit I am stuck on is the SWITCH aspect:

         

        I get as far as : Sales (selected currency)= SWITCH(), TRUE,

        [....

        When I enter the field Sales Value it doesn't recognise it, is it do with the type of field it is?

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    SWITCH() syntax:

    Measure = SWITCH(SELECTEDVALUE(ForSlicer[Currency]),"EUR",<expression1>,"USD",<expression2>,"GBP",<expression3> )

     

    Actually I'm a little confused about your scenario since there are [Sales Values] for each Currency and each Customer...

    Let's take a example: If you choose "EUR" in slicer, do you want to change the original value for GBP and USD to EUR as well ? Like this:

     

    Please provide me with more details about your expected output.

     

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Could you tell me if my post helps you a little? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.Hope to hear from you‌‌

     

    Best Regards,
    Eyelyn Qin