Forum Discussion
fraz
4 years agoRegular Visitor
Optimising measure to replace URL column
I have a dataset with a table containing barcodes, and I have been generating a URL from these with a simple concatenation in SQL prior to import by my Power BI dataset. e.g.: 'https://first-part-of...
johnt75
Super User
4 years agoNot sure how much difference it would make but you could try replacing VALUES with SELECTEDVALUE.
- fraz4 years agoRegular Visitor
I changed SELECTEDVALUE to VALUES when I entered the HASONEVALUE condition. I think it would only speed things up if I removed that IF condition to just make it
Item URL = "https://first-part-of-url.com/" & SELECTEDVALUE('Item Summary'[Barcode]
But then I'd end up with the URL missing a Barcode if it was in a filter context with more than one Barcode i.e. "https://first-part-of-url.com/"
====
Update - I tested using SELECTEDVALUE:
Item URL = IF(
HASONEVALUE('Item Summary'[Barcode]),
"https://first-part-of-url.com/" & SELECTEDVALUE('Item Summary'[Barcode])
)That takes me up to 1900 ms. So that's not the one.
Appreciate the suggestion though!