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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Prasadmohan
Frequent Visitor

Scalar Value Error

Hello Any one can help error " The expression refers to multiple columns.Multiple columns cannot be converted to a scalar value"

 

Dax formula below

1 MTDYTD =
2 var TodayDate = TODAY()
3 var YearStart = CALCULATE(STARTOFYEAR(FactGlTran[Month Year]),YEAR(FactGlTran[Month Year]) = YEAR(TodayDate) )
4 var QuarterStart = CALCULATE(STARTOFYEAR(FactGlTran[Month Year]),YEAR(FactGlTran[Month Year]) = YEAR(TodayDate),QUARTER(FactGlTran[Month Year]) = QUARTER(TodayDate) )
5 var MonthStart = CALCULATE(STARTOFMONTH(FactGlTran[Month Year]),YEAR(FactGlTran[Month Year]) = YEAR(TodayDate),MONTH(FactGlTran[Month Year]) = MONTH(TodayDate) )
6 var Result =
7 UNION (
ADDCOLUMNS(
9      CALENDAR(YearStart,TodayDate),
10       "Selection", "YTD"
11  ),
12   ADDCOLUMNS(
13      CALENDAR(MonthStart,TodayDate),
14        "Selection","MTD"
15   ),
16  ADDCOLUMNS(
17      CALENDAR(QuarterStart,TodayDate),
18    "Selection", "QTD"
19  )
20 )
21 Return
22 Result
 
Best regards
Prasad

 

1 REPLY 1
lbendlin
Super User
Super User

Measures can use table variables during processing but can only return a single value at the end.  Your code tries to return a table.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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