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
Demidovich
Frequent Visitor

Filling blanks with previous available week data

Hello everyone.

I need some help here.

 

My raw data is shown below

01.png02.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

In case of any blank in "Deviation" column, I want to replace it with the data in previous available week for the project.

In order to do that I created a calculated column "Filled_deviation":

 

Filled_Deviation = 
VAR CAL =
    CALCULATE (
        FIRSTNONBLANK ( 'Table'[Deviation], 'Table'[Deviation] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[Title] ),
            EARLIER ( 'Table'[WeekNum] ) > 'Table'[WeekNum]
        )
    )
RETURN
    IF ( ISBLANK ( 'Table'[Deviation] ), CAL, 'Table'[Deviation] )

 

 

and got this result:

 

03.png04.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

As you can see, this formula works almost fine except for a couple of projects:

project 2 should have "0" for the 16th week,

project 14 should have "10" for the 16th week,

and project 18 should have "11" for that week.

 

This is my .pbix file if you need it: https://drive.google.com/open?id=1k_DpRupUxGiMHr70FfZl2OT4FetjRBSp

 

Tell me please what I'm doing wrong.

Any help would be very appreciated.

 

2 REPLIES 2
MFelix
Super User
Super User

Hi @Demidovich,

 

On the query editor choose the deviation column and fill down should work as you need.

 

filleddown.gif

 

Regards,

MFelix

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix ,
Thank you for your response and trying to help.
Please note that I need to fill column with the latest available data.
For example, “project 6” has no value on 13-15 weeks, so right values on 13-16 weeks would be “blank, blank, blank , 0”.
“Project 15” has no value on 13th week, in this particular case values should be “blank, 0, 0, 0”.

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.