Forum Discussion
Handling tables in memory
- 5 years ago
lazarus1907
You can acheive the expected result by creating the following table:MyTable = VAR Tab1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } VAR Tab2 = { 4, 5, 7 } RETURN ADDCOLUMNS ( Tab1, "Found", VAR C1 = [Value] RETURN CALCULATE ( COUNTROWS ( FILTER ( Tab2, [Value] = C1 ) ) ) + 0 )________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply š
Thank you for the reply, but Power BI does not accept table1[value] when table1 is a variable and not a normal table. That's the problem I had.
lazarus1907
You can acheive the expected result by creating the following table:
MyTable =
VAR Tab1 = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }
VAR Tab2 = { 4, 5, 7 }
RETURN
ADDCOLUMNS (
Tab1,
"Found",
VAR C1 = [Value]
RETURN
CALCULATE ( COUNTROWS ( FILTER ( Tab2, [Value] = C1 ) ) ) + 0
)________________________
If my answer was helpful, please click Accept it as the solution to help other members find it useful
Click on the Thumbs-Up icon if you like this reply š
- lazarus19075 years ago
Helper I
Genius! Thank you very much!!!
I'd swear I've tried something very very similar to what you wrote, but I obviously did something wrong -probably when to filter.