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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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