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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RyanStO
New Member

Calculated Column Fill Down

Hello,

 

I am looking to fil down a column based on a Customer Reference column in order to fill null entries with the last non blank entry for that customer which would look like the fixed_status column

 

Sample:

 

Customer-RefDateStatusFixed_Status
A31/12/2015nullNull
A01/01/2016HoldHold
A01/01/2016nullHold
A03/01/2016nullHold
A04/01/2016ActiveActive
A05/01/2016nullActive
A06/01/2016HoldHold
A07/01/2016nullHold
B08/01/2016ActiveActive
B09/01/2016nullActive
B10/01/2016HoldHold
B11/01/2016nullHold

 

From some research i think i need to use lastnonblank with a filter based on the customer ref like:

 

https://community.powerbi.com/t5/Desktop/Filling-Data-Gaps-Conditionally/td-p/148745

 

but this soultion does not completely fit my needs as an example for customer A on the 7th is filled as "Active" rather than "Hold", same for customer B on the 11th filled as "Active" rather than "hold"

 

im not sure if it complicates the situation in that a customer can have more than one entry on a particular date.

 

I am new to DAX

 

Thank you for any help

 

 

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

You can use this column expression to get your result.  You may need to change "null" to "", if they are actually null values (vs. the word null).

 

 

NewStatus =
VAR vThisDate = 'Status'[Date]
RETURN
    CALCULATE (
        LASTNONBLANKVALUE (
            'Status'[Date],
            MIN ( 'Status'[Status] )
        ),
        ALLEXCEPT (
            'Status',
            'Status'[Customer-Ref]
        ),
        'Status'[Date] <= vThisDate,
        'Status'[Status] <> "null"
    )

 

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.