Forum Discussion
BlastS
Helper I
7 years agoCount Number test[Column(Failures)] = 1 when column X last row = 0.2
I am new to dax formulas i already tryend some things but nothing is realy working to get this result, actualy i got this columns for use to this calculation: Index;Failures; ColumnX; 1 ...
- 7 years ago
Try something like:
Count of Failures = VAR __table = ADDCOLUMNS('Table',"__failure",IF([Failures]=1 && MAXX(FILTER('Table',[Index]=EARLIER([Index])-1),[ColumnX])=.2,1,0)) RETURN SUMX(__table,[__failure])
Greg_Deckler
Community Champion
7 years agoTry something like:
Count of Failures =
VAR __table = ADDCOLUMNS('Table',"__failure",IF([Failures]=1 && MAXX(FILTER('Table',[Index]=EARLIER([Index])-1),[ColumnX])=.2,1,0))
RETURN SUMX(__table,[__failure])Anonymous
7 years agoNot applicable
Count ASD =
VAR __table = ADDCOLUMNS(Geradores,"__failure",IF([Failure Event]=1 && MAXX(FILTER('Geradores',[Index]=EARLIER([Index])-1),[columnX)])=.2,1,0))
RETURN SUMX(__table,[__failure])
i tryed this and its returning some insane values i cant understand dwhy, it should return only 7 instead of 135.
Count all 1 failures events that has columnx index-1 = 0.2 what could possibly be wrong ?
- Greg_Deckler7 years ago
Community Champion
Not sure, seems to work for me. See Page 10 and Table 15 in attached file.- BlastS7 years ago
Helper I
I manipulate a litle bit your solution to my case and it worked, thanks buddy.
My problem was the index, since i got for example 8 datasets the index was the same for each dataset so i create a new one for all and it work fine.
Solution:
FailuresCount = IF([Failure])=1 && MAXX(FILTER('Table',[Index]=EARLIER([Index])-1),[ColumnX)])=.2,1,0)- Greg_Deckler7 years ago
Community Champion
BlastS - Awesome! Glad you got it!