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 dateJoin 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.
Hello Power BI Community,
I have a question on how to remove a date value from a column. Due to the less than optimal layout of the data in the original file, I need to do some data manipulation to extract the data from an Excel file that is manually updated.
Because of how I need to manipulate the data (Fill up, use first row as headers, unpivot, etc.) I need to remove the value in the first row of the first column. This is a date value and is of the format dd-mm-yy. It is the only value in this column that has dashes and I would like a way to replace this value with a null value so I can use the fill up command to fill from the second row to the first row and use that as headers.
Thank you for any help you can provide.
Solved! Go to Solution.
Hi @Anonymous
Give something like this a go.
let
Source = Table.FromColumns(
{
{#date(2023, 12, 19), "", null, "HeaderRow1", "HeaderRow2"},
{"", "", "Period", "P1", "P2"}
}
),
ReplaceValue = Table.ReplaceValue(
Source,
each [Column1],
each if [Column1] is date then null else [Column1],
Replacer.ReplaceValue,
{"Column1"}
)
in
ReplaceValue
I hope this is helpful
Hi @Anonymous
Give something like this a go.
let
Source = Table.FromColumns(
{
{#date(2023, 12, 19), "", null, "HeaderRow1", "HeaderRow2"},
{"", "", "Period", "P1", "P2"}
}
),
ReplaceValue = Table.ReplaceValue(
Source,
each [Column1],
each if [Column1] is date then null else [Column1],
Replacer.ReplaceValue,
{"Column1"}
)
in
ReplaceValue
I hope this is helpful
Awesome! That worked.
As a back up solution, I changed the type of Column1 to Text and looked for the "-".
= Table.ReplaceValue( #"Changed Type1", each [Column1],
each if Text.Contains( [Column1], "-" ) then null
else [Column1],
Replacer.ReplaceValue, {"Column1"}
)
Thank you very much for your help.
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 |
---|---|
8 | |
6 | |
5 | |
5 | |
5 |
User | Count |
---|---|
10 | |
8 | |
6 | |
6 | |
6 |