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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ceov95
Regular Visitor

Replace a null value with the value from the column of the left

So I have this data and I have some null values that doesn't work for me, and I need to replace them with the value from the left column, do you know if it's possible?

 

This is the snapshot of the data I have:
Power BI Problem.PNG

 

So for example second row in "abril-2020" I'd need to have the second row value from "marzo-2020".

 

Thanks in advance.

1 ACCEPTED SOLUTION

To avoid that issue, before you unpivot, you can replace all the nulls with a value you'll replace back with null later.  Highlight all your columns to unpivot and replace values, replacing "null" with 9999999 or something like that.  You then unpivot and then replace the 9999999 with null, fill down, etc.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
camargos88
Community Champion
Community Champion

Hi @ceov95 ,

 

You can unpivot the date columns and fill down/up.

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Yes, the thing is in the previous step I had it unpivoted but as this Item Code didn't any movement during april the database table didn't save the record for that month, here I attach a snapshot of the data before the unpivot:

 

Power BI Problem 2.PNG

 

So when I unpivot the the table, and because other Item Codes have had any movement during april it shows me the null value.

To avoid that issue, before you unpivot, you can replace all the nulls with a value you'll replace back with null later.  Highlight all your columns to unpivot and replace values, replacing "null" with 9999999 or something like that.  You then unpivot and then replace the 9999999 with null, fill down, etc.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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