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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
smpa01
Community Champion
Community Champion

DAX UDF – Can a Function Accept Multiple Column References?

@jeffrey_wang @AlexisOlson

 

I defined a simple function like this, which works perfectly when passing a single column reference:

DEFINE FUNCTION get_table = (col:anyref) =>
    ALLSELECTED(col)

get_table(DimProduct[Category])

 

However, I would like to reuse the same function and pass multiple columns, like this:

get_table(DimProduct[Category], DimProduct[Subcategory])

 

Currently, this does not work.

From what I understand:

  • UDFs do not support variadic parameters

  • There is no array/list-of-columns type in DAX

  • Overloading is not supported

At the moment, the only workaround seems to be defining separate functions for each number of column parameters (e.g., 2-column version, 3-column version, etc.).

Is there currently any supported way for a DAX UDF to accept multiple column references dynamically?
If not, is this a known limitation and potentially on the roadmap?

Thank you.

 


========================
Did I answer your question? Mark my post as a solution!
Proud to be a Super User
My Custom Visualization Projects
• Plotting Live Sound: Live Sound
• Beautiful News: Women in Parliament, Energy Mix, Shrinking Armies
• Visual Capitalist: Working Hrs
• Others: Easing Graph, Animated Calendar
MayViz Submissions
• Week 1: View
• Week 2: View
========================
1 ACCEPTED SOLUTION
jeffrey_wang
Power BI Team
Power BI Team

This is a known limitation. There is ongoing discussion about potential solutions, but nothing has been finalized yet. If the input columns are known in advance, you can pass their names into the function as a small table and then use the SWITCH function to map the strings back to column references.

View solution in original post

1 REPLY 1
jeffrey_wang
Power BI Team
Power BI Team

This is a known limitation. There is ongoing discussion about potential solutions, but nothing has been finalized yet. If the input columns are known in advance, you can pass their names into the function as a small table and then use the SWITCH function to map the strings back to column references.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.