Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ap072619
New Member

Replace Value in Top Row

I'm trying to load monthly invoices from pdf files and working on my Transform Sample File. The formatting is not Power Bi-friendly and stacks the invoice number and invoice date in consecutive rows. I need to move the date field up to the top row so that I can delete the bottom row and rename my columns. Example 1 is what it currently looks like, and example 2 is what I need it to look like. Is that possible?

 

ap072619_0-1645135853602.png

 

 

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @ap072619 ,

 

You can add a custom column to return the pure number part first, and then compare it with Column3. If the custom column is equal to Column3, it means that the new line is not a date, and return null, otherwise return a date.

 

1.Add a custom column.

vstephenmsft_0-1646642565178.png

vstephenmsft_1-1646642575774.png

 

2.Fill up.

vstephenmsft_2-1646642645527.png

vstephenmsft_3-1646642655293.png

 

3.Filter out the Invoice Number, remove the unneeded columns.

vstephenmsft_4-1646642667431.png

Result:

vstephenmsft_6-1646642795929.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @ap072619 ,

 

You can add a custom column to return the pure number part first, and then compare it with Column3. If the custom column is equal to Column3, it means that the new line is not a date, and return null, otherwise return a date.

 

1.Add a custom column.

vstephenmsft_0-1646642565178.png

vstephenmsft_1-1646642575774.png

 

2.Fill up.

vstephenmsft_2-1646642645527.png

vstephenmsft_3-1646642655293.png

 

3.Filter out the Invoice Number, remove the unneeded columns.

vstephenmsft_4-1646642667431.png

Result:

vstephenmsft_6-1646642795929.png

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

watkinnc
Super User
Super User

I would just change Column 3 to type date, and then replace the errors that you get with nulls (errors from dates not being converted to numbers) using the Replace Errors option via right click on the column. Then I would use the Fill Up function, which will replace the nulls with the date below it. Then you can just filter out the word "Date" from Column 2. That should do it!

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Unfortunately, it just converts the other numbers to dates. I guess as a last-ditch effort, I can still use that and filter out the "wrong" dates, but that will get complicated since the wrong date will constantly change based on the invoice number.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors