0
votes

I have tried to fix the out of present range problem in Power Bi Dax formula

General background

I have a data-set as below, the dashboard allows the user to select the preferred currency and then the table update the value. For example, if click on the US, then the table sum all Sales in Jan from the US

as well as showing $ or € accordingly

enter image description here

The DAX function I have tried is

CONCATENATE( Table[Country]="US", "$",FORMAT(sum(Table[Sales]),"0")

but it comes up with below error

Couldn't load the data for this visual

The following system error occurred: Out of present range

Any help, please. thanks

1
CONCATENATE does not take that kind of input. Only text.msdn.microsoft.com/en-us/query-bi/dax/concatenate-function-daxmxix

1 Answers

0
votes

You don't need to use any concatenation. You can simply put the currency symbol in the FORMAT function. For example:

Measure = SWITCH(SELECTEDVALUE(Table[Country]),
              "EUR", FORMAT(SUM(Table[Sales]), "€0.00"),
              "US",  FORMAT(SUM(Table[Sales]), "$0.00"),
              "UK",  FORMAT(SUM(Table[Sales]), "£0.00"))