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 (
8 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