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
chrisgehm
Helper III
Helper III

IF - True statement text

Hi everyone!

I'm just starting to work with Power BI.

In the desktop version, I've create  new column (Calculated)

So what I need is to create a new column and put values acording to the first column.

 

ie:

Column A has numeric values, from 0 to 1000.

So I need to put in column B:

If Column A is lower than 500, put "Lower than 500", else "Higher than 500"

 

What I use is:

B = IF(Table[A]<500,"Lower than 500","Higher than 500")

 

But it doesn't work.

 

Any idea why?

27 REPLIES 27
v-shex-msft
Community Support
Community Support

Hi @chrisgehm

 

Did you use the direct query mode to connect the datasource? If Dax formula still has the issue, I'd like to suggest you use power query formula.

 

#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each if [Column] >5 then "Greate than 5" else "Less than 5")

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Sean
Community Champion
Community Champion

@chrisgehm

Are you getting an error message? Can you elaborate a little more.

 

Because there's nothing wrong with the formula as you've described it.

 

 

New Column B.png

Captura.PNG

Sean
Community Champion
Community Champion

@chrisgehm

I'm guessing your regional setting may require ; instead of ,

 

try this instead

 

B = IF ( Table[A] < 500; "Lower than 500"; "Higher than 500" )

Hope this helps! Smiley Happy

Captura.PNG

Still having the same problem

What is the data type for  your column 'A', is it number? Can you check in your data mode? Just make sure it is not treated as Text



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Captura.PNG

Yep, numeric

What is the language setting that you are using in Windows ?

Spanish

Seems like it is related to your regional settings, can you check what regional setting you have ? Not sure double quotes need to be change to single quote 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Windows uses spanish

I've tried with single quotes, but also didn't work

Can you check regional settings in PowerBI,

 

-go to menu

-options and settings

-options

-regional settings

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Under regional settings --> Addtional Setting

 

Check what is the List Seperator defined. Use that one or change it to comma(,)

Folks he said he got the same error with , and with ;

I changed my regional setting as yours and tested the formula and it worked, not sure what else to tell. @FarhanAhmed1984 mentioend something for you to take a look, can you check?

 

Also, can you change your regional settings for "English (USA)" and test it. It is only for testing purpose.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I've change both system and pbi settings to usa, but still got the same problem

Sean
Community Champion
Community Champion

Is there a line separator other than , or ;

Don't know why, but when I use this formula, it works a bit wired:

 

B = if(Movimientos[A]<500,1,0)

 

Captura.PNG

It means it has to do with string qualifier.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Seems this works, but can't undestand why:

 

B = if(Movimientos[A]<500,1,"Lower","Higher")

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.