Forum Discussion
Do not sum certain columns in matrix. Show values based on filter level?
- 7 years ago
Actually if you fix the syntax errors in my previous code the same approach will work for both the fee and pcnt (assuming that the row with the blank WBS2 is a total row so it should be shown for the WB1 line and hidden as a WBS2 line
Fee Amt =IF( HASONEVALUE(Data[WBS2]),CALCULATE(SUM(Data[Fee]), FILTER(VALUES(Data[WBS2]),Data[WBS2] <> "")),CALCULATE(SUM(Data[Fee]),Data[WBS2] ="" ))
You could probably do this in a measure, using HASONEVALUE to detect if the current context is showing data drilled down to WBS2 or not and then either filter to only include or exclude the row with a blank WBS2 code. (I'm filtering based on an empty string, but if that does not work you might have to try using ISBLANK() depending on how your data is loaded)
Fee Amt = IF( HASONEVALUE(Project[WBS2])
,SUM(Project[Fee], FILTER(VALUES(Project[WBS2]) <> "")
,SUM(Project[Fee], FILTER(VALUES(Project[WBS2]) = "")
)