DAX Table with a variable based upon a selected value in a silicer
I have a DAX Table defined as follows:
var JCType=IF(NOT ISEMPTY(vwJCTransactionsRev2),SELECTEDVALUE('ProjectCalc'[Calc Method]))
var JCProject =
The Accounting Year column noted above is a variable. If the selected value in a slicer is equal to "Year", then the value should be zero, otherwise the data from the source should be from the [AccountingYear] Column.
So the "AccountingYear" Column in the grid visual the data will either be rolled up for one line item for each project number, or it will have multiple line items displayed based upon the Project Number and the "AccountingYear" column.
This would be either a Summary DAX table or a Detailed DAX Table in the visual grid, based upon the selected value in the slicer.
The results don't change in the AccountingYear column (it's always showing the AccountingYear value, it doesn't shift from "AccountingYear" value to the Zero, yet the selection is displayed correctly in the grid for the JCType Column.
How do I resolve this DAX Code to return the expected results?