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
rf5896
New Member

IF/Swtich with Measure - A table of multiple values was supplied where a single value was expected

Hi all,

 

I am facing a very weird error, please help:

 

1. I have a Measure that reads the Currency Code called "Project Currency"

2. I am using an If/Switch Statement to check this Currency

3. In regards to what currency it is, I Multiple the exchange rate to a column called "Exp"

4. EXP is NOT a measure

5. I am facing this error : "A table of multiple values was supplied where a sigle value was expected"

6. My code : 

CurCol =
IF([Project Currency] = ("AED"), 'Union SAP Past/Forecast Exp'[Exp] * 4.2373,
IF([Project Currency] = ("QAR"), 'Union SAP Past/Forecast Exp'[Exp] * 4.1998,
IF([Project Currency] = ("OMR"), 'Union SAP Past/Forecast Exp'[Exp] * 0.44363,
IF([Project Currency] = ("SAR"), 'Union SAP Past/Forecast Exp'[Exp] * 4.32672))))

 

Note: I used this before and it worked flawlessly and is still working in my old Dashboard.

2 ACCEPTED SOLUTIONS
PhilipTreacy
Super User
Super User

@rf5896 

Try this

CurCol =
IF( SELECTEDVALUE([Project Currency]) = "AED", 'Union SAP Past/Forecast Exp'[Exp] * 4.2373,
IF( SELECTEDVALUE([Project Currency]) = "QAR", 'Union SAP Past/Forecast Exp'[Exp] * 4.1998,
IF( SELECTEDVALUE([Project Currency]) = "OMR", 'Union SAP Past/Forecast Exp'[Exp] * 0.44363,
IF( SELECTEDVALUE([Project Currency]) = "SAR", 'Union SAP Past/Forecast Exp'[Exp] * 4.32672
)
)
)
)

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

v-alq-msft
Community Support
Community Support

Hi, @rf5896 

 

You may try the following measure to see if it works.

CurCol =
switch(
     [Project Currency],
     "AED",sum('Union SAP Past/Forecast Exp'[Exp])*4.2373,
     "QAR",sum('Union SAP Past/Forecast Exp'[Exp])*4.1998,
     "OMR",sum('Union SAP Past/Forecast Exp'[Exp])*044363,
     "SAR",sum('Union SAP Past/Forecast Exp'[Exp])*4.32672
)

 

Best Regards

Allan

 

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

 

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @rf5896 

 

You may try the following measure to see if it works.

CurCol =
switch(
     [Project Currency],
     "AED",sum('Union SAP Past/Forecast Exp'[Exp])*4.2373,
     "QAR",sum('Union SAP Past/Forecast Exp'[Exp])*4.1998,
     "OMR",sum('Union SAP Past/Forecast Exp'[Exp])*044363,
     "SAR",sum('Union SAP Past/Forecast Exp'[Exp])*4.32672
)

 

Best Regards

Allan

 

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

 

PhilipTreacy
Super User
Super User

@rf5896 

Try this

CurCol =
IF( SELECTEDVALUE([Project Currency]) = "AED", 'Union SAP Past/Forecast Exp'[Exp] * 4.2373,
IF( SELECTEDVALUE([Project Currency]) = "QAR", 'Union SAP Past/Forecast Exp'[Exp] * 4.1998,
IF( SELECTEDVALUE([Project Currency]) = "OMR", 'Union SAP Past/Forecast Exp'[Exp] * 0.44363,
IF( SELECTEDVALUE([Project Currency]) = "SAR", 'Union SAP Past/Forecast Exp'[Exp] * 4.32672
)
)
)
)

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


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.

Top Solution Authors