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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.