Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
maryjanesmith
Helper I
Helper I

IF statement in a measure which is ("n.a") when is equal to a condition otherwise is a number

Hi,
I have this condition about a customize table constructed with a switch statement:

if.eager(values('Rubricas Financeiras'[Rubricas])="% EBITDA","n.a",[Finance value YTD]-[Finnce Value Orç YTD])

But I received this error:
Error "Cannot convert type text "n.a" to type numeric"

Can you help, please?
Thank you!
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@maryjanesmith , if state both part should return same datatype . n/a is text

 

if.eager(values('Rubricas Financeiras'[Rubricas])="% EBITDA","n.a",([Finance value YTD]-[Finnce Value Orç YTD] )& "")

 

or

 

if.eager(values('Rubricas Financeiras'[Rubricas])="% EBITDA",blank(),([Finance value YTD]-[Finnce Value Orç YTD] ))

View solution in original post

v-jayw-msft
Community Support
Community Support

Hi @maryjanesmith ,

 

I failed to reproduce the scenario. I create a similar formula and it just works fine.

Measure 2 = IF.EAGER(SELECTEDVALUE(Table1[country])="US","n.a",SUM(Table1[sales]))
Check if you could set the format and data category as same as the screenshot below.
vjaywmsft_0-1651049285876.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @maryjanesmith ,

 

I failed to reproduce the scenario. I create a similar formula and it just works fine.

Measure 2 = IF.EAGER(SELECTEDVALUE(Table1[country])="US","n.a",SUM(Table1[sales]))
Check if you could set the format and data category as same as the screenshot below.
vjaywmsft_0-1651049285876.png

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
maryjanesmith
Helper I
Helper I

@amitchandak I understand that but the client wants this message to appear. Is there any way to do that?
Thank you!

amitchandak
Super User
Super User

@maryjanesmith , if state both part should return same datatype . n/a is text

 

if.eager(values('Rubricas Financeiras'[Rubricas])="% EBITDA","n.a",([Finance value YTD]-[Finnce Value Orç YTD] )& "")

 

or

 

if.eager(values('Rubricas Financeiras'[Rubricas])="% EBITDA",blank(),([Finance value YTD]-[Finnce Value Orç YTD] ))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.