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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
alex-JF
Frequent Visitor

populating empty slots with data

Hi there,

I need some kind of way to populate column "name" with names by some algorithm going through names, in indexed order and if name field empty previous name from previous fields from the same column should be used, until it reaches new name and starts populate fields with new name. I've been trying to create funtion for that but it's just too complicated for me, need help.

Added examples of data what I've got (left picture), and what I want to get (right picture) Examples created in Excel but the real data in power bi and I need a solution for it

got.jpgshould be.jpg

 

1 ACCEPTED SOLUTION

Hi @alex-JF ,

Plesae create a calculated column.

Name 2 = 
VAR _index =
    CALCULATE (
        MAX ( 'Table'[Index] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Index] <= EARLIER ( 'Table'[Index] )
                && 'Table'[name] <> ""
        )
    )
VAR _result =
    CALCULATE (
        MAX ( 'Table'[name] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Index] = _index )
    )
RETURN
    _result

vcgaomsft_0-1682565806481.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

5 REPLIES 5
alex-JF
Frequent Visitor

https://community.powerbi.com/t5/Desktop/Dax-fill-down-in-formula/m-p/318991
something along this topic, but it can't work with string type, which I need here 

Hi @alex-JF ,

Plesae create a calculated column.

Name 2 = 
VAR _index =
    CALCULATE (
        MAX ( 'Table'[Index] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Index] <= EARLIER ( 'Table'[Index] )
                && 'Table'[name] <> ""
        )
    )
VAR _result =
    CALCULATE (
        MAX ( 'Table'[name] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Index] = _index )
    )
RETURN
    _result

vcgaomsft_0-1682565806481.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Many thanks, works like a charm!

alex-JF
Frequent Visitor

It could solve this problem, but I'm getting this table as a result of some calculation inside power bi, working with data after power query stage. So it should some kind of "for like" cicle inside of power bi 

m_dekorte
Super User
Super User

Hi @alex-JF,

 

Bring your table into Power Query

Make sure the [Name] column has nulls not empty text strings. If it does contain empty text strings go to the Transform tab, make sure the [Name] column is highlighted, select "Replace values" leave the search for field blank and enter null in the replace with field (do not add quotes!). Now you should see nulls in the empty spaces (with a right alignment)

Final step is right click the column header, select Fill, Fill Down

 

Ps. If this helps solve your query please mark this post as Solution, thanks!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors