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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Quentin_Ernesti
Regular Visitor

Why do I get an error when I use the LEN in this IF ??

Hi,

Any idea why Power BI tells me that I have an error when I use this formula for a new column? 

date_rappel_inbound - Heure =
IF(
    LEN('hubspot deal'[date_rappel_inbound]) < 11,
    "short",
    "long"
)

It works when I replace "short" and "long" by 0 and 1, but for some reason it seems that when I try to get some text as an output, it gives me an error saying that there is something wrong with my calculated column.

Quentin_Ernesti_0-1700175799997.png



I m really lost here, thanks !



5 REPLIES 5
Quentin_Ernesti
Regular Visitor

Nevermind, I rearranged the field inside the visual and suddenly it works fine....

Ahmedx
Super User
Super User

try this

IF(
LEN(MAX('hubspot deal'[date_rappel_inbound])) < 11,
"short",
"long"
)

Sadly it didn't work.

Quentin_Ernesti_1-1700229069246.png

 



I really don't get why it seems to think of it as a number, when it's clearly a text and the data type is a text.

Quentin_Ernesti
Regular Visitor

Hi Vicky,
Thanks for your answer, but the field that shows "Somme de da..." is actually the field that I am showing in the formulae and the one that I am indeed trying to solve! 😉

vicky_
Super User
Super User

I suspect that it's because the Somme de date_ra... measure relies on the calculation for date_rappel_inbound - Heure. So you will need to fix that measure for it to work.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.