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

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.

Reply
proavinash
Helper I
Helper I

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

proavinash_0-1746858984427.png

please suggest a solution.

1 ACCEPTED SOLUTION

Hi @proavinash,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

The UNION function returns a table as a result, so rather than creating a measure, try creating a calculated table.

vsaisraomsft_0-1747039878915.png

Please refer the below Document:
UNION function (DAX) - DAX | Microsoft Learn

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

View solution in original post

7 REPLIES 7
v-saisrao-msft
Community Support
Community Support

Hi @proavinash,

 

We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.

 

Thank you.

proavinash_0-1748271845887.png

not working same error

v-saisrao-msft
Community Support
Community Support

Hi @proavinash,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

DataNinja777
Super User
Super User

Hi @proavinash ,

 

The error occurs because UNION() only accepts two tables at a time, but you're passing in three ADDCOLUMNS() results directly. DAX cannot interpret more than two tables unless you nest the UNION() calls. To fix it, you need to combine the second and third ADDCOLUMNS() calls using UNION() first, then combine that result with the first one. Here's the corrected version of your DAX:

MTD/QTD/YTD =
var TodayDate = TODAY()
var startyear = CALCULATE(STARTOFYEAR(SaleDump[Date].[Date]), YEAR(SaleDump[Date]) = YEAR(TodayDate))
var startquarter = CALCULATE(STARTOFQUARTER(SaleDump[Date].[Date]), YEAR(SaleDump[Date]) = YEAR(TodayDate), QUARTER(SaleDump[Date]) = QUARTER(TodayDate))
var startmonth = CALCULATE(STARTOFMONTH(SaleDump[Date].[Date]), YEAR(SaleDump[Date]) = YEAR(TodayDate), MONTH(SaleDump[Date]) = MONTH(TodayDate))
var result =
    UNION(
        ADDCOLUMNS(CALENDAR(startyear, TodayDate), "Selection", "YTD"),
        UNION(
            ADDCOLUMNS(CALENDAR(startquarter, TodayDate), "Selection", "QTD"),
            ADDCOLUMNS(CALENDAR(startmonth, TodayDate), "Selection", "MTD")
        )
    )
RETURN
    result

This corrects the structure so each UNION() has exactly two inputs and avoids the scalar value conversion error.

 

Best regards,

proavinash_0-1746954336463.png

SAME ERROR AGAIN.

Hi @proavinash,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.

Hi @proavinash,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

The UNION function returns a table as a result, so rather than creating a measure, try creating a calculated table.

vsaisraomsft_0-1747039878915.png

Please refer the below Document:
UNION function (DAX) - DAX | Microsoft Learn

 

If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.

 

Thank you.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.