Forum Discussion

SNik's avatar
SNik
Helper I
10 years ago
Solved

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

  • 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.

     

     

     

    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]

     

     

     

    Hope it helps

2 Replies

  • konstantinos's avatar
    konstantinos
    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.

     

     

     

    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]

     

     

     

    Hope it helps

    • SNik's avatar
      SNik
      Helper I

      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