There must be something very obvious that I'm missing here. I am using SWITCH function to create circa 20 bars on a bar chart that cumulate values from a different table.
SWITCH(
VALUE(SELECTEDVALUE(Table1[RowNo])),
1, CALCULATE([m1] + [m2], Table2[Key] IN {"0-5", "05-10"}),
2, CALCULATE([m1] + [m2], Table2[Key] IN {"10-15", "15-20"}),
3, CALCULATE([m1] + [m2], Table2[Key] IN {"20-25", "25-30"}),
...
)
I thought that I will use IN operator (for the simplicity), instead of using a long version (example for the first bar):
CALCULATE([m1] + [m2], Table2[Key] = "0-5") + CALCULATE([m1] + [m2], Table2[Key] = "05-10")
However, IN operator doesn't seem to work as I thought it would:
CALCULATE([m1] + [m2], Table2[Key] = "0-5") -> returns 10,000
CALCULATE([m1] + [m2], Table2[Key] = "05-10") -> returns 20,000
Long version:
CALCULATE([m1] + [m2], Table2[Key] = "0-5") + CALCULATE([m1] + [m2], Table2[Key] = "05-10") -> returns 30,000 (this is what I want)
Short version (with IN):
CALCULATE([m1] + [m2], Table2[Key] IN {"0-5", "05-10"}) -> returns 20,000 (incorrect; IN seems to always return the value for the second reference)
Could you please help me adjusting my formula so that it returns the correct result (30,000)? I'm happy to provide some further information if needed.
Edit:
here's an exemplary dataset - left table (Table1) and right table (Table2):

In PowerBI, these two tables do not have any relationship in a Data Model. Table2 has two measures:
m1 = MAX(Table2[F])
m2 = MAX(Table2[R])
Table1 also has two measures (for comparison purposes):
mSwitch =
SWITCH(
VALUE(SELECTEDVALUE(Table1[RowNo])),
1, CALCULATE([m1] + [m2], Table2[Key] IN {"0-5", "05-10"}),
2, CALCULATE([m1] + [m2], Table2[Key] IN {"10-15", "15-20"}),
3, CALCULATE([m1] + [m2], Table2[Key] IN {"20-25", "25-30"})
)
mSwitch2 =
SWITCH(
VALUE(SELECTEDVALUE(Table1[RowNo])),
1, CALCULATE([m1] + [m2], Table2[Key] = "0-5") + CALCULATE([m1] + [m2], Table2[Key] = "05-10"),
2, CALCULATE([m1] + [m2], Table2[Key] = "10-15") + CALCULATE([m1] + [m2], Table2[Key] = "15-20"),
3, CALCULATE([m1] + [m2], Table2[Key] = "20-25") + CALCULATE([m1] + [m2], Table2[Key] = "25-30")
)
As you can see on the screenshot below, there is a difference between mSwitch and mSwitch2 (mSwitch2 returning the correct results):

m1andm2defined?