DAX Extract values from column

MarkCBB

Active Member
Joined
Apr 12, 2010
Messages
497
Hi there,

I am fairly new to DAX, I have a table called RB and a column called Answers, the answer column has numeric and Alpha entries, I need to add 2 new columns, the one has the extaced numeric answers and the other has the extracted Alpha answers.

Can someone assist me with the correct DAX to do the above?

Look forward to the help.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi there,

Just to follow on from the above, I found another way to do this (I am sure there is a better way). I duplicated the Answer Column and change the format of the one to whole number and the other to text and this seems to have solved the challenge.

I am still interested in seeing what other ways there are to do this.

Thank you
 
Upvote 0
NumericColumn=if(isnumber([answer]),[answer],blank()) //then type the column as number
AlphaColmn=if(isnumber([answer]),blank(),[answer]) //then type the column as text

Depending on what values you encounter, you may need to encapsulate the above with iferror()
 
Upvote 0
Hi PentaGalCXO,

Am I correct in assuming that this needs to be done in the Power BI window and not in the PQ window? (when I try your formula in the PQ Editor window. I get syntax errors. (PQ Editor > Add Column > Add Custom Column
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,257
Members
449,075
Latest member
staticfluids

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