Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hi!
This is doing my head in, maybe because it's not possible. I've got this DAX:
Solved! Go to Solution.
just so I understand, you are hoping for a user defined function with column name as parametrs in dax. Something like
// Function to sum up values in a specified column
function sumColumn(data, column) {
return data.reduce((sum, row) => sum + (row[column] || 0), 0);
}
// Example usage
const data = [{'colA': 1, 'colB': 2}, {'colA': 3, 'colB': 4}];
const sumColA = sumColumn(data, 'colA');
const sumColB = sumColumn(data, 'colB');
console.log(`Sum of colA: ${sumColA}`); // Output: Sum of colA: 4
console.log(`Sum of colB: ${sumColB}`); // Output: Sum of colB: 6
But I don't think in the current capacity of dax, this is possible. However, there is a buzz about udf coming to dax. Not sure what functionalities it will offer.
Hi @Newcolator,
Thank you @smpa01 for your response.
Has your issue been resolved?If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone.
If yes, kindly accept the useful reply as a solution and give us Kudos. It would be appreciated.
Thank you for your understanding!
just so I understand, you are hoping for a user defined function with column name as parametrs in dax. Something like
// Function to sum up values in a specified column
function sumColumn(data, column) {
return data.reduce((sum, row) => sum + (row[column] || 0), 0);
}
// Example usage
const data = [{'colA': 1, 'colB': 2}, {'colA': 3, 'colB': 4}];
const sumColA = sumColumn(data, 'colA');
const sumColB = sumColumn(data, 'colB');
console.log(`Sum of colA: ${sumColA}`); // Output: Sum of colA: 4
console.log(`Sum of colB: ${sumColB}`); // Output: Sum of colB: 6
But I don't think in the current capacity of dax, this is possible. However, there is a buzz about udf coming to dax. Not sure what functionalities it will offer.
Yes, that would be very useful. If it's not possible at the moment that's fine. I will stop trying to make it work! Thanks.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 9 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 28 | |
| 20 | |
| 20 | |
| 19 | |
| 12 |