Forum Discussion
Griffin_BI
4 years agoFrequent Visitor
Finding Intersection between two columns
I have two tables: Table1: ID Letter 1 a 2 b 3 c 4 d 5 e 6 f 7 g 8 h 9 i And a virtual table, Table 2 ID 1 2 How do I find...
Griffin_BI
4 years agoFrequent Visitor
Not sure what I'm doing wrong here. I get an error saying that a multiple values were supplied when a single value was expected?
VAR _indextbl = GENERATESERIES(1, PATHLENGTH([Sample List]))
VAR _Table2 =
GENERATE(_indextbl, ROW("@ID", PATHITEM(_indextbl, [Value], 0)))
VAR _SampleTbl =
CALCULATETABLE(
ALLSELECTED('Table1'),
TREATAS(
SELECTCOLUMNS(Table2, "ID", [@ID]),
'Table1'[ID]
)
)
VAR _Xbar =
AVERAGEX(
SUMMARIZE(
_SampleTbl,
'Calendar'[Month],
"@X", AVERAGE(LengthOfTime)
),
[@X])
RETURN
_XBar
_XBar
OwenAuger
4 years agoSuper User
One problem I can see is that the first argument of PATHITEM is currently _indextbl, but it should be a vertical bar delimited string, presumably [Sample List].