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
Danielnir
Helper II
Helper II

Summarising with exceptions

Hi, I have a dataset containing the below columns:

1. Region - with just "UK" and "USA" values

2. Category - stuff like "sales", "direct expences" etc. 

3. Value - without currency symbol but it's in dollars for USA region and in pounds for UK region

4. All to £ - converts all USA values to pounds

5. All to $ - converts all UK values to dollars.

 

In the report, I have a slicer with "UK", "USA" and "BOTH". Another one is showing currency selector. Both slicers are based on separate datasets and are connected to the source datasets with the values in cardinality one-to-many.  

I wrote a simple metric that summarises data for both countries and lets you convert those values from one currency to another.

 

I need an addition to my metric that will summarise values for both regions but will exclude some categories. At the same time it will still let you convert currencies. 

 

I'm sending you what I've got:

 

Cur NOM Actual = 
var Currency1 = SELECTEDVALUE('Currency'[Currency])
var USD = sum('Nominal Ledger Transactions Li'[Values in $])
var GBP = sum('Nominal Ledger Transactions Li'[Values in £])

return

If(Currency1 = "GBP", GBP, USD)

 

Tried to use the "switch" function instead but failed... It's not showing any value when I use it...

 

An additional feature would include adding currency symbols to the values.

 

May I ask for suggestions on how to do it?

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Danielnir ,

For currency conversions, see the following articles:

https://community.powerbi.com/t5/Desktop/Currency-conversion/m-p/2121369 

vluwangmsft_0-1644396222017.png

vluwangmsft_1-1644396229002.png

Best Regards

Lucien

lbendlin
Super User
Super User

Please show more of your data model. Please explain how you handle the "Both"  selection  - what decides the output currency?

 

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

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.