Forum Discussion
Count changes in a value/column
- 4 years ago
This turned out to be context issue that was solved by using ALLSELECTED versus ALL:
Changed Column = VAR __DateTime = [DateTime] VAR __PreviousDateTime = MAXX(FILTER(ALLSELECTED('Table'),[DateTime]<__DateTime),[DateTime]) VAR __PreviousPart = MAXX(FILTER(ALLSELECTED('Table'),[DateTime]=__PreviousDateTime),[Part]) RETURN IF([Part]=__PreviousPart,0,1)
It finally updated the card with "Changed Measure Total TD" and instead of the 34 it says in your book, it says 52k. It seems like the measure does not see the filter(s) which have been applied and is applying the measurement to the entire column regards of any filtered/sliced value.
Edit: Was able to fix this by changing ALL in the measure formula to VALUES, but the measure still returns the same value as the column formula (which is not the right value).
Locco Any possibility of you sharing your PBIX either via a shared link or privately via email. That's going to be the quickest resolution to this. Otherwise, I need a lot more information about what is going on in your model like how relationships are defined, etc. I can't imagine why merging the queries would cause a problem. When you are editing your formula for TD, are you catching both of the places you replace part?
Changed Column =
VAR __DateTime = [DateTime]
VAR __PreviousDateTime = MAXX(FILTER('Table',[DateTime]<__DateTime),[DateTime])
VAR __PreviousPart = MAXX(FILTER('Table',[DateTime]=__PreviousDateTime),[Part]) //change [Part] to [TD} here
RETURN
IF([Part]=__PreviousPart,0,1) // also need to change [Part] to [TD] here