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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.