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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

In-body function

Hi folks, I'm trying to create an in-body function, can anyone help? I can create a calable external function... but in this case I would prefer to create an in-body one.

 

This is the code for the table

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlaK1YlWMgKThkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
CallRecursive = Table.AddColumn
(
Source,
"Recursive",
each (Recursive) => Table.SelectRows(Source, each if [Column1] = 0 then 1 else [Column1] * @Recursive([Column1] - 1))

)
in
CallRecursive

 

 

 

ricardoinjapan_0-1706916924360.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I didn't know how to close this issue, I was able to find what I was looking for:

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlaK1YlWMgKThkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),

#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type number}}),

//----------------------
Factorial = (num) => if num = 0 then 1 else num * @Factorial (num-1) ,
//----------------------

#"Added Custom" = Table.AddColumn(#"Changed Type", "Factorial", each Factorial([Column1]))
in
#"Added Custom"

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

ok, what is your question?

Anonymous
Not applicable

I didn't know how to close this issue, I was able to find what I was looking for:

 

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlaK1YlWMgKThkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),

#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type number}}),

//----------------------
Factorial = (num) => if num = 0 then 1 else num * @Factorial (num-1) ,
//----------------------

#"Added Custom" = Table.AddColumn(#"Changed Type", "Factorial", each Factorial([Column1]))
in
#"Added Custom"

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.