Forum Discussion
DAX Table - Filter Based on Selected Value
It seems like there might be a few issues with your DAX formula.
In your CALCULATETABLE function, you are specifying the 'Award Master File' table twice. The first instance of the table should be replaced with the table or expression you want to filter by. In your case, it should be replaced with the table or expression that contains the field [Main Project # Selected].
You are also using the SELECTEDVALUE function to get the value of [Main Project # Selected]. This function only works when a single value is selected in the slicer. If multiple values are selected, the function will return an error. You might want to consider using the VALUES function instead, which will return a table of unique values for the selected column.
Here's an updated version of your formula which I hope will work!
Table 3 =
CALCULATETABLE (
'Award Master File',
FILTER (
'Award Master File',
RIGHT ( 'Award Master File'[Award], 4 ) = RIGHT ( VALUES ( 'Main Project Master File - PMF'[Main Project] ), 4 )
)
)
I've used the VALUES function instead of SELECTEDVALUE, and I've replaced the first instance of 'Award Master File' with the VALUES function. I've also removed the second instance of 'Award Master File' since it's not needed.
I hope this helps!