The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'd kindly like to ask how to remove the dates from the this column so that they are blank and then replace the blank cells with the region by filling down. So basically the dates should be replaced with the area names above.
Thanks in advance.
Solved! Go to Solution.
Hi @HamidBee ,
Please try the following formula to directly tranform the column instead of adding a new custom column:
#"Transformed Column"= Table.ReplaceValue(Table.TransformColumns(#"Changed Type",{"Column1",each Text.Remove(_,{"0".."9"})}) ,"//",null,Replacer.ReplaceValue,{"Column1"} ),
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @HamidBee ,
Please try the following formula to directly tranform the column instead of adding a new custom column:
#"Transformed Column"= Table.ReplaceValue(Table.TransformColumns(#"Changed Type",{"Column1",each Text.Remove(_,{"0".."9"})}) ,"//",null,Replacer.ReplaceValue,{"Column1"} ),
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your response. I'll give this ago and see how I Find it. My manager showed me a quick way to di it in Excel. Create a column numbered from one to however many rows you have. Sort the dates/string column by alphabetical order. The dates will all be grouped together, delete the dates and then sort again by the new ID column you created. It may be better in this instance to clean it in Excel just because the data set could be large. Having said that I really like your solution, I wish I could one day get to that level of coding.
How I would do it
1) make an extra helping column, depicting the rows with dates:
Add conditional column (Helpcolumn) > if column1 contains "/" Then null Else OK
2) add an extra column with the correct contents
Add Conditional column (Cleaned): if Helpcolumn equals OK Then Column1 Else Helpcolumn
With the last statement you just grabbed the normal information from your first initial column (Aberdeen etc) and gave null (blank values) when it's a date.
Now, if you select the output column (Cleaned) and then hit Fill > Down, it should do exactly what you requested.
to
Cheers
Thank you for the help.
This is a good method and I think there may be a few ways to do it like this. I was however trying to find a way to do it without creating any columns although I'm not sure that it's possible.
Have you tried the column from example in power query?
Type the region names as they are next to a few regions and delete any attempt to replicate a date. If it looks like it works, inspect the M expression it writes for you.
Could you please explain some of the steps I'm not quite sure what to do here.
Thanks