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
Syndicate_Admin
Administrator
Administrator

Cómo extraer los primeros caracteres X + "..."

Hola, me gustaría utilizar esta función para calcular una columna:

Shortened URLs (limited) = 
IF
( LEN
(LEFT('Google Search Console - Summarized'[shortened URLs],15)) < 15,
 LEFT('Google Search Console - Summarized'[shortened URLs],15),
  LEFT('Google Search Console - Summarized'[shortened URLs],15) + "...")

sin embargo, me dice que la expresión no puede usar el tipo de datos variante. ¿Hay alguna solución para esto?

AndrejBI_1-1615559798032.png

Básicamente me gustaría extraer 15 caracteres, y si la cadena es más de 15 añadir "..." al final.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@AndrejBI Creo que es el + en su fórmula en lugar de &. Pruébalo así.

Column = 
VAR _Len = LEN ( 'Google Search Console - Summarized'[shortended URLs] )
VAR _URL = LEFT ( 'Google Search Console - Summarized'[shortended URLs],15)
VAR _Adder = IF ( _Len <= 15, "", "...")
RETURN _URL & _Adder

jdbuchanan71_0-1615560379102.png

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@AndrejBI Creo que es el + en su fórmula en lugar de &. Pruébalo así.

Column = 
VAR _Len = LEN ( 'Google Search Console - Summarized'[shortended URLs] )
VAR _URL = LEFT ( 'Google Search Console - Summarized'[shortended URLs],15)
VAR _Adder = IF ( _Len <= 15, "", "...")
RETURN _URL & _Adder

jdbuchanan71_0-1615560379102.png

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.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors
Top Kudoed Authors