Forum Discussion
Need help with Measure
Hello PowerBI Professionals!
I have 2 Measures that seem to work individually, but combined they somehow don't show the values they should.
First Measure is:
as soon as the second Measure [_ExchangeRate] is added, I get weird results...
Is the Syntax wrong to divide something that gets returned?
4 Replies
- lbendlinSuper User
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523- KevBIHelper I
Okey sorry for the bad data.
_AmountIn(€)SUM = SUMX(EKBE, [Amt.in loc.cur.]) / EKBE[_ExchangeRate]
-This is what I did for the correct calculation but I still need the logic in the calculation that i left out on this one.
Do you need any more data from me?- lbendlinSuper User
Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided
- KevBIHelper I
Trying to add the Data like that because I can't upload the Report.
WBS Element Inv. Category PO Number Amount in local Currency Exchange Rate Amount in € Invoices WPO21P0003.020 CAPEX 6300091034 6551097.42 4.3 1523511,03 507837,01
Amount in Local Currency = This is the Base Value that should get calculated to €
Exchange Rate = This is the Exchange Rate that always gives the correct Rate, 4.3 in this example
(as this is the correct value that gets put out, the problem has to be in this Measure:
Invoice =VAR __BASELINE_VALUE = CALCULATE(SUMX('EKBE', EKBE[Amt.in loc.cur.])*2, 'EKBE'[Debit/Credit ind] IN { "H" })VAR __MEASURE_VALUE = SUMX('EKBE', EKBE[Amt.in loc.cur.])RETURNIF(NOT ISBLANK(__MEASURE_VALUE), (__MEASURE_VALUE - __BASELINE_VALUE) / [_ExchangeRate])
If I try to leave the divide by [_ExchangeRate]) out, I get the correct value out of the previous Measure.
The only thing that is not working is the calculation with Exchange Rate (so divided by 4.3 in this case).
If I try to divide in another Measure with [_ExchangeRate]), it also calculates correctly, like in this case ->
_AmountIn(€)SUM = SUMX(EKBE, [Amount in Local Currency]) / EKBE[_ExchangeRate]
I hope this is enough data.