Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello everyone,
I would like to find a solution for a problem regarding the SUBSITUTE function.
I have a string of procceses in the following format:
[|Process1|,|Process2|,|Proces3|, ...]
I would like to split this string into multiple columns in order to have each process in a separat column. I find the solution, but when I tried to integrate it on one project that uses DirectQuery as Storage Mode I realize that my logic does not work because the SUBSTITUTE function accept only 3 parameters, not 4 as it works in the Import Mode.
The syntax I used is the following:
Solved! Go to Solution.
@Anonymous Any chance you can use a measure? More DAX functions are supported in measures rather than calculated columns. Also, if you can use SUBSTITUTE in a measure and replace all occurences with "|" (pipe character) then you can use PATHITEM to retrieve individual parts instead of using FIND, MID, etc.
@Anonymous Why can't you just turn it into a PATH by replacing each instance with "|". Why do you need to replace each one individually?
Hi @Greg_Deckler ,
Thank you for your message!
For example, in order to extract the second process from a string that contains 6 processes the code is the following:
@Anonymous Any chance you can use a measure? More DAX functions are supported in measures rather than calculated columns. Also, if you can use SUBSTITUTE in a measure and replace all occurences with "|" (pipe character) then you can use PATHITEM to retrieve individual parts instead of using FIND, MID, etc.
Hi @Greg_Deckler ,
Thank you a lot for the solution.
I used the PATHITEM function to split my string in multiple columns.
Have a wonderful day!
Dia
The errors is:
Function 'SUBSTITUTE' is not allowed as part of calculated column DAX expressions on DirectQuery expressions on DirectQuery models.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |