The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have sales fact table that has columns for sales in local currency, Sales in USD, Sales in EUR, Sales in GPB and the local currency code.
I have a exchange rate table that reports each currency exhange rate against the 3 reporting currencies. Instead of reporting by just 3 currencies we want to report by all the different local currencies. I created a measure called Sales currency, so we are going from just the USDs to multi-currencies.
My questions are,
1) Is there a way to leverage just the sales amount in local currency columns and total sales displayed by default currency of usds (when nothing is selected)?
Thank you in advance. Link to the power bi report
Solved! Go to Solution.
Hi @chutchut09 ,
I suggest you to create an unrelated Currency Code table for slicer.
Sales Currency =
IF (
MAX ( 'Dim Currency'[Currency Code] )
IN VALUES ( 'Slicer Currency'[Currency Code] ),
IF (
ISFILTERED ( 'Slicer Currency'[Currency Code] ),
IF (
ISCROSSFILTERED ( 'Dim Currency' ),
VAR SelectedCurrency =
SELECTEDVALUE ( 'Dim Currency'[Currency Code], "USD" )
VAR DatesExchange =
SUMMARIZE (
FILTER (
'Fact Exchange Rate',
'Fact Exchange Rate'[Reporting Currency] = "USD"
),
'Fact Exchange Rate'[MMM-YYYY],
'Fact Exchange Rate'[Exchange Rate]
)
VAR Result =
IF (
NOT ISBLANK ( SelectedCurrency ),
IF (
SelectedCurrency = "USD",
[Total Sales_USD],
SUMX ( DatesExchange, [Total Sales_USD] * 'Fact Exchange Rate'[Exchange Rate] )
)
)
RETURN
Result
),
[Total Sales_USD]
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I decided to keep what I have. I know the ask is a bit bizzare. It works! thank you for posting this alternative solution.
Hi @chutchut09 ,
I suggest you to create an unrelated Currency Code table for slicer.
Sales Currency =
IF (
MAX ( 'Dim Currency'[Currency Code] )
IN VALUES ( 'Slicer Currency'[Currency Code] ),
IF (
ISFILTERED ( 'Slicer Currency'[Currency Code] ),
IF (
ISCROSSFILTERED ( 'Dim Currency' ),
VAR SelectedCurrency =
SELECTEDVALUE ( 'Dim Currency'[Currency Code], "USD" )
VAR DatesExchange =
SUMMARIZE (
FILTER (
'Fact Exchange Rate',
'Fact Exchange Rate'[Reporting Currency] = "USD"
),
'Fact Exchange Rate'[MMM-YYYY],
'Fact Exchange Rate'[Exchange Rate]
)
VAR Result =
IF (
NOT ISBLANK ( SelectedCurrency ),
IF (
SelectedCurrency = "USD",
[Total Sales_USD],
SUMX ( DatesExchange, [Total Sales_USD] * 'Fact Exchange Rate'[Exchange Rate] )
)
)
RETURN
Result
),
[Total Sales_USD]
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
82 | |
63 | |
54 | |
52 |
User | Count |
---|---|
127 | |
118 | |
81 | |
65 | |
64 |