Forum Discussion
asjones
Helper V
2 years agoDAX - All() Not working when FILTER() also used
I have the following DAX code that is close, but the ALL() is not removing the filters on Period_GL.
CALCULATE (
[LOA - Original Budget - NO IDC CO-DO]
, ALL( Period_GL )
, Filter( 'Main Project Master File - PMF' , [Main Project Active] = 1 )
)
If I remove the FILTER() then the code with the ALL() works
CALCULATE (
[LOA - Original Budget - NO IDC CO-DO],
ALL ( Period_GL )
)
I don't like the FILTER() in the calculate, but ran into errors when I did not have that and needed a dynamic check for "active".
Any ideas or suggestions? Love to hear differnet thoughts.
thanks
Alan
6 Replies
- asjones
Helper V
Great question, I was focusted on the FILTER() and did not look closer. For a quick test I changed the FILTER() line to
, Filter( 'Main Project Master File - PMF' , 1= 1 )and my results were correct.... the ALL() removed the slicers I had on the page.The measure Main Project Actiive is this... (it is ugly, but we have screwy data).Main Project Active =VAR __Period_Selected = SELECTEDVALUE ( Period_GL[Period] )VAR __FY_Year_of_Perid_Selected = LEFT ( __Period_Selected, 4 )VAR __Period_Begining_of_FY = VALUE ( __FY_Year_of_Perid_Selected & "00" )VAR __Period_End_of_FY = VALUE ( __FY_Year_of_Perid_Selected & "13" )RETURNif( CALCULATE( [Programmatic Actuals (with IDC)] + [Prog Working Bud Select FY no IDC] + [Board Budget (USD)] + [LOA - Original Budget with IDC CO-DO] ,ALL ( Period_GL ),__Period_Begining_of_FY <= Period_GL[Period]&& __Period_End_of_FY >= Period_GL[Period]) <> 0 , 1 , 0) - asjones
Helper V
i thought i had posted enough, but realize my question is still confusing ... i will pull my question and try and repost it with more details. I was worried all the details would make it more confusing and people would not read it.
thanks for trying