Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have a column in a table that mixes several types of values. Numbers, text, symbols and null values. How can i build a separate column that has only the numeric values and ignores all the others. I've tried the following but didn't work:
if [ANSWER_VALUE] is number then [ANSWER_VALUE] else 999
Thanks.
Solved! Go to Solution.
Hi @qmest ,
Try using this in a new custom column:
Table.AddColumn(
previousStep,
"newColumnName",
each Text.Combine(
List.RemoveNulls(
List.Transform(
Text.ToList([ANSWER_VALUE]),
each if Value.Is(Value.FromText(_), type number) then _ else null
)
)
)
)
Pete
Proud to be a Datanaut!
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyVorViVZydHIG02AiptTAwMisLk4pNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Mixed = _t]),
#"Only Numeric" = Table.AddColumn(Source, "Numeric", each try Number.From([Mixed])??999 otherwise 999)
in
#"Only Numeric"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @qmest ,
Try using this in a new custom column:
Table.AddColumn(
previousStep,
"newColumnName",
each Text.Combine(
List.RemoveNulls(
List.Transform(
Text.ToList([ANSWER_VALUE]),
each if Value.Is(Value.FromText(_), type number) then _ else null
)
)
)
)
Pete
Proud to be a Datanaut!
Perfect. Thank you!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
8 | |
7 | |
6 | |
6 |