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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
GeekAlfPro
Resolver II
Resolver II

filldown with condition

Hello,

 

i've a table that i want to filldown, with a condition, based on another column.

it doesn't work

here is my code

 

= if (#"Colonnes supprimées1"{+1}[Numero client] = #"Colonnes supprimées1"{1}[Numero client]) then Table.FillDown(#"Colonnes supprimées1",{"Nom client", "Prenom client"}) else null

 

the trouble is that the if statement is not recognized 

the left column is my reference et the right the result of the filldown

 

2020-07-24 13_58_53-Données Coralie Dédommagement - Éditeur Power Query.png

 

do you know where i am wrong ?

 

thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjS0sDQ3NFXSUXLJT8kHUsGOQY4eQNrAQt/QQN/IwMBYKVYHWR0U4RG0NDA0tyRLMBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Numero client" = _t, #"Nom client" = _t, #"Prenom client" = _t, #"Date naissance" = _t]),
    cols=Table.ColumnNames(Source),
    tab=Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue, cols),
   #"Grouped Rows" = Table.Group(tab, {"Numero client"}, {{"fill", each Table.FillDown(_,cols)}}),
    #"Expanded fill" = Table.ExpandTableColumn(#"Grouped Rows", "fill", {"Nom client", "Prenom client", "Date naissance"}, {"Nom client", "Prenom client", "Date naissance"})
in
    #"Expanded fill"

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

it is not clear your starting point, but I guess you could try to fill.down after group by "numero client":

 

somethink like this (I didn't tested it)

Table.Group (#"Colonnes supprimées1", "Numero client", { each Table.FillDown(_,{"Nom client", "Prenom client"})})

 

Hi Rocco,

 

thanks for your response.

i tried your suggest, but i've the following message : 

Expression.Error: We cannot convert a value of type Function to type List.
Details:
Value=[Function]
Type=[Type]

i'm pretty new to M and it's not easy for me...

i tried to adapt your code, but without success...

Anonymous
Not applicable

copy and paste you code here ...

 

paste also the data (dummy version is ok)  you need to transform and the expected result.

 

Paste these as copiable table, please!

 

 

here are the dummy data

in red the wanted filldown 

when "Numero Client" change, i don't want a filldown anymore

maybe the trouble come from some of my blue values are blank

 

Numero clientNom clientPrenom clientDate naissance
1189715DodoSARAH08/10/2003
1189715DodoSARAH08/10/2003
1189715DodoSARAH08/10/2003
1190179  
1190179   
1190179   
Anonymous
Not applicable

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjS0sDQ3NFXSUXLJT8kHUsGOQY4eQNrAQt/QQN/IwMBYKVYHWR0U4RG0NDA0tyRLMBYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Numero client" = _t, #"Nom client" = _t, #"Prenom client" = _t, #"Date naissance" = _t]),
    cols=Table.ColumnNames(Source),
    tab=Table.ReplaceValue(Source,"",null,Replacer.ReplaceValue, cols),
   #"Grouped Rows" = Table.Group(tab, {"Numero client"}, {{"fill", each Table.FillDown(_,cols)}}),
    #"Expanded fill" = Table.ExpandTableColumn(#"Grouped Rows", "fill", {"Nom client", "Prenom client", "Date naissance"}, {"Nom client", "Prenom client", "Date naissance"})
in
    #"Expanded fill"

Hi Rocco,

 

thanks a lot, it works fine !

thanks again

 

have a good day

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors