Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I was wondering if you gurus can help. I'm trying to replace all the different dates that appear in the value column with either 0 or null whichever works in the power query. Thank you in advance.
Hi @cool_333 ,
Try this, using Table.TransformColumns:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VZBLDsUgDAPvwjpS8wGSd5aK+1+jTwWp9tIzFii+76Z+aV6uHk1aVVvyZwHMquTgjniUxMYDsOvpTuxmytw46eUuvnFRO6Rv/AOcdv4zxfIXXmfojB1eCuF1dHGwo7M7u0GTsKMJJjva4QtrPQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, ValueIni = _t]),
#"Added Custom" = Table.AddColumn(Source, "Value", each try Number.FromText([ValueIni]) otherwise Date.FromText([ValueIni])),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"ValueIni"}),
#"Changed Type" = Table.TransformColumnTypes(#"Removed Columns",{{"Date", type date}}),
#"===Start here" = #"Changed Type",
#"Replaced Date" = Table.TransformColumns(
#"===Start here",
{
{"Value", each if Value.Is(_, Date.Type) then null else _ }
}
)
in
#"Replaced Date"
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 |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |