The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, I would like to use this function to calculate a column:
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) + "...")
yet it tells me that expression can't use variant data type. Is there a workaround for this?
I would basically like to extract 15 characters, and if the string is longer than 15, add "..." at the end.
Solved! Go to Solution.
@Anonymous I think it is the + in your formula instead of &. Try it like this.
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
@Anonymous I think it is the + in your formula instead of &. Try it like this.
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