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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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