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
SNik
Helper I
Helper I

Get previous not NULL record

Hi

I have some Hierarchy data like

 

Product      Model

  A                NULL

  NULL          A1 Name

  NULL          A1 Description

 B                  NULL

NULL            B1 name

NULL            B1 Description

NULL            B2 name

NULL            B2 Description

Questions:

1- what should be my approach? i know that Hierarchy is not supported yet

2- I like to "Add a Column" that will give me the previous record that is not null something like 

 

Product      Model                            NewColum

  A                NULL                               A

  NULL          A1 Name                        A

  NULL          A1 Description               A

 B                  NULL                             B

NULL            B1 name                        B

NULL            B1 Description               B

NULL            B2 name                       B

NULL            B2 Description               B

 

how can i do that?

thanks

Sincerely
Nik- Shahriar Nikkhah
1 ACCEPTED SOLUTION
konstantinos
Memorable Member
Memorable Member

@SNik When you load the data in select the column "Product"  go to "Transform" and then Select from the menu "Fill Down".

Then you have your new column.

 

1.png

 

 

Depending your data model and how you would like to display the data you can a) filter out the null values in Model or b) you can add the Product in the model column.

For the first select the column drop down menu and unselect null

For the second "Add custom column" and the formula will be 

if [Model] = null then [Product] else [Model]

 

3.png

 

 

2.pngHope it helps

Konstantinos Ioannou

View solution in original post

2 REPLIES 2
konstantinos
Memorable Member
Memorable Member

@SNik When you load the data in select the column "Product"  go to "Transform" and then Select from the menu "Fill Down".

Then you have your new column.

 

1.png

 

 

Depending your data model and how you would like to display the data you can a) filter out the null values in Model or b) you can add the Product in the model column.

For the first select the column drop down menu and unselect null

For the second "Add custom column" and the formula will be 

if [Model] = null then [Product] else [Model]

 

3.png

 

 

2.pngHope it helps

Konstantinos Ioannou

I love your simple and perfect solution, i know that PowerBI is not and ETL/CleanUp tool but it does alot

Anyways thank you very much

Sincerely

Nik

Sincerely
Nik- Shahriar Nikkhah

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.