How to tansform the following DAX formula in a Power Query Formula?

Skype

New Member
Joined
Sep 8, 2015
Messages
16
Hello,

this does relate to my earlier post and might be a solution to it: My question is how could I translate the following Dax formula to a PowerQuery Formula?

=iferror(Right(Left([Kennzeichen];Search("A";[Kennzeichen];1)+6);6);"")

I would jump all day if I find a solution for that :-D
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hope you had a good lunch then :-)

if Text.PositionOf([Kennzeichen],"a") >= 0 then Text.End(Text.Start([Kennzeichen],Text.PositionOf([Kennzeichen],"a")+7),6) else null

- Why 7 and not 6?: Power Query starts to count at 0, so the first position will be returned as 0!
- If a is not found, -1 will be returned, so different case check then
- Power Query is case sensitive!!
 
Last edited:
Upvote 0
Hi Skype :-)
You have to change "a" to "A" in ImkeF formula (as ImkeF said, PQ is case sensitive)
Alternatively you can use this one below (or you can write many others)
Code:
try Text.Start(Text.Split([Kennzeichen], "A"){1}, 6) otherwise null

Regards
 
Upvote 0
Hi Imke :-)
You are right, of course but one little note about my solution.
This is only for data set presented at the picture by skype. This is not universal solution so the result for different data set can be improper.

Regards and sq :-)
 
Upvote 0
Amazing. That works. Thank you so much guys.

May I just ask you another question? How can I save this query so that sb just has to import the raw files and everything is done automatically? or do I always have to insert the formulas to perform the query?
 
Upvote 0
Amazing. That works. Thank you so much guys.

May I just ask you another question? How can I save this query so that sb just has to import the raw files and everything is done automatically? or do I always have to insert the formulas to perform the query?

Ok I got the second question as well now :-D
 
Upvote 0

Forum statistics

Threads
1,224,118
Messages
6,176,485
Members
452,730
Latest member
palsmith

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top