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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

error "arguments were passed to a function which expects 2"

Hi

Please help me

I subscribed to Cluster API on azure data marketplace,

I tried to "score" my columns for it to return cluster, the below is my M function. I used energy dataset.

My question is how do I pass 2 parameters in this statement?

#"Grouped Rows" = Table.Group(#"Changed Type1", {"YEAR", "k"}, {{"Data", each Score(_), type record}})

where each Score("this is the record", "this is K")

I tried each Score(_,"5") where 5 is k value but it doesnt like that 😞

Help plz

 

 

 

 

let
Source = Csv.Document(File.Contents("energy.csv"),[Delimiter=",", Columns=27, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"STATE", type text}, {"YEAR", Int64.Type}, {"GenTotal", type number}, {"GenHydro", type number}, {"GenSolar", type number}, {"GenTotalRenewable", type number}, {"GenSolarBinary", Int64.Type}, {"GenTotalRenewableBinary", Int64.Type}, {"AllSourcesCO2", type text}, {"AllSourcesSO2", type text}, {"AllSourcesNOx", type text}, {"EPriceResidential", type number}, {"EPriceCommercial", type number}, {"EPriceIndustrial", type number}, {"EPriceTransportation", type number}, {"EPriceTotal", type number}, {"EsalesResidential", type number}, {"EsalesCommercial", type number}, {"EsalesIndustrial", type number}, {"EsalesTransportation", type number}, {"EsalesOther", type text}, {"EsalesTotal", type number}, {"CumlFinancial", Int64.Type}, {"CumlRegulatory", Int64.Type}, {"Total.salary", type number}, {"presidential.results", Int64.Type}, {"Import", Int64.Type}}),
#"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"YEAR", "GenTotal"}),
#"Added Custom" = Table.AddColumn(#"Removed Other Columns", "k", each "5"),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom",{{"k", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type1", {"YEAR", "k"}, {{"Data", each Score(_), type record}})
in
#"Grouped Rows"

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous,

 

Since I'm not clear your function, can you provide more detail information about the "Score" function or share me a sample file?

 

Do you want to get the below effect?

Capture3.PNG

 

If as I said, you can refer to below formula:

 

#"Grouped Rows" = Table.Group(#"Added Custom", {"Year", "k"}, {{"Data",each {_{0}[Year]&","&_{0}[k]},type record}})

  

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors