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)
Thanks Greg_Deckler, I appreciate your help and patience.
In your book, you are using measures. I've been using calculated columns and never used measures. You have a column, "Changed Column GJD," this also returns the same incorrect value which is in my book.
Should I be using measures or calculated columns?
Locco There is nothing incorrect about Changed Column GJD. It is based on Part, not TD and correctly identifies when the Part has changed. You can use a column or measure. A measure is generally advised if you want the calculation to be dynamic such as based on user input/interaction. Measures are also preferrable in the sense that they do not add to the space consumed by the data model to the same extent as columns. I added a column for the TD calculation. See updated PBIX file attached.