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

Can I pass a reference to a custom column creation

Hi there, sorry just one more thing.

 

I am trying to pass w parameter or refernce for creating custom table. Is it possible ?

 

Ua case:

 

From previous problem which I had I am able to find the column Header name which I want to pass to the Next Custom Column Condition.

 

By Passing the Coulmn header name which is recivied by the function I need to make a math function over the data from this colum.

 

Initally I wanted to use a Query :

 

= let
Source = @#"Table",
ColumnName = #"Dynamic_ColumnName",
#"Added Conditional Column" = Table.AddColumn(Source, "Test Score", each if ColumnName <> "" then ColumnName/12 else null)
in
#"Added Conditional Column"

 

 

but I see in the reference there is only Column Header Name provided instead values so I'm getting error:

 

We cannot apply operator / to types Text and Number

 

Any suggestions ? Thank you.

1 REPLY 1
jbwtp
Memorable Member
Memorable Member

Hi @Trabka,

 

The ColumnName in your code seems to be type text not type number. Use something like Number.From(ColumnName)/12 to fix it.

 

Cheers,

John

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.

Top Solution Authors
Top Kudoed Authors