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
gsksarepta
Helper II
Helper II

Help on Missing data fill techniques

Hi, I have table like this in PowerBI I need to fill the missing values in 4th column based on the respective values step3afin column.. for example. Here is the before after table I am hoping to get from this tranformation.. Copy down and copy up is not doing fill correctly because the non-empty value position varies. any help is appreciated. I am okay either new column or filling the exisiting column

 

  Table Before     Table after transformation
step1runstep2tffstep3afinstep4aex   step1runstep2tffstep3afinstep4aexnewresult
ab11tff1ds1    ab11tff1ds1 aeds2
ab11tff2ds1    ab11tff2ds1 aeds2
ab11tff3ds1aeds2   ab11tff3ds1aeds2aeds2
ab11tff4ds1    ab11tff4ds1 aeds2
ab51tff5ds5    ab51tff5ds5 aeds6
ab51tff6ds5aeds6   ab51tff6ds5aeds6aeds6
ab51tff7ds5    ab51tff7ds5 aeds6
ab51tff8ds5    ab51tff8ds5 aeds6
ab91tff9ds9aeds10   ab91tff9ds9aeds10aeds10
ab91tff10ds9    ab91tff10ds9 aeds10
ab91tff11ds9    ab91tff11ds9 aeds10
ab91tff12ds9    ab91tff12ds9 aeds10
ab131tff13ds13    ab131tff13ds13 aeds14
ab131tff14ds13    ab131tff14ds13 aeds14
ab131tff15ds13    ab131tff15ds13 aeds14
ab131tff16ds13aeds14   ab131tff16ds13aeds14aeds14
ab141tff17ds14    ab141tff17ds14  
ab141tff18ds14    ab141tff18ds14  
ab141tff19ds14    ab141tff19ds14  
ab141tff20ds14    ab141tff20ds14  
ab151tff21ds15    ab151tff21ds15 aeds16
ab151tff22ds15    ab151tff22ds15 aeds16
ab151tff23ds15aeds16   ab151tff23ds15aeds16aeds16
ab151tff24ds15    ab151tff24ds15 aeds16
1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @gsksarepta ,

Please try to create a new column with below dax formula:

newresult =
VAR _step3 = [step3afin]
VAR _a =
    CALCULATE (
        MAX ( 'Table'[step4aex] ),
        FILTER ( 'Table', [step3afin] = _step3 )
    )
RETURN
    _a

vbinbinyumsft_0-1705902551491.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
v-binbinyu-msft
Community Support
Community Support

Hi @gsksarepta ,

Please try to create a new column with below dax formula:

newresult =
VAR _step3 = [step3afin]
VAR _a =
    CALCULATE (
        MAX ( 'Table'[step4aex] ),
        FILTER ( 'Table', [step3afin] = _step3 )
    )
RETURN
    _a

vbinbinyumsft_0-1705902551491.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for this, appreciate it. 

amitchandak
Super User
Super User

@gsksarepta , First use clean and trim on the column and post that replace '' (Means do not give any thing) with null

(All small case)

 

Then try fill up and down

 

 

Power Query Trim and Clean : https://youtu.be/NRYPsCnS0w4

Power Query Replace Value: https://youtu.be/hkZhZbR7Kmk

Fill Up Fill Down: https://youtu.be/mC2ps0pFqBI

Throwback- Learn Power BI: Replace Values, Text Operations, Append Tables, Merge Tables - https://youtu.be/cN8AO3_vmlY?t=37070

Hi Amit @amitchandak , I didn't understand your response, do you mind adding some more details on what to do ?  Meanwhile, I will go through the links for ideas. Thanks for your time. 

bhanu_gautam
Super User
Super User

@gsksarepta , Try using this method

 

newresult =
VAR CurrentRow = YourTable[step4aex]
VAR NonEmptyValues =
FILTER(
YourTable,
YourTable[step3afin] = CurrentRow
&& NOT(ISBLANK(YourTable[step4aex]))
)
VAR Result =
IF(
COUNTROWS(NonEmptyValues) > 0,
CALCULATE(
MAXX(NonEmptyValues, NonEmptyValues[step4aex])
),
BLANK()
)
RETURN Result

 

Please accept as solution and give kudos if it helps





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

Proud to be a Super User!




Hi @bhanu_gautam Thanks for your time, I tried it on my PowerBI Table view added it as column measure but got this error, do you see any issues with the script or the way I did?  

gsksarepta_1-1705720047214.png

 

 

Try this

newresult =
VAR CurrentRow = YourTable[step4aex]
VAR NonEmptyValues =
VALUES (
FILTER (
YourTable,
YourTable[step3afin] = CurrentRow
&& NOT(ISBLANK(YourTable[step4aex]))
)
)
VAR Result =
IF (
COUNTROWS(NonEmptyValues) > 0,
MAXX(NonEmptyValues, [step4aex]),
BLANK()
)
RETURN
Result





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

Proud to be a Super User!




Hi, tried the new code but got a different error, attached my pbix file on this google drive, would it be possible to take a look and let me know ? Thanks again. 

https://drive.google.com/file/d/1gXOXu8-kSHrN_LjLnhlQ2az52wKCsmbT/view?usp=drive_link

Thanks, I will try this and reach out. 

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.