Forum Discussion
zenz
2 years agoFrequent Visitor
DAX New Column Error - not enough memory
Hi there, I am using Power BI Desktop: Version: 2.130.930.0 64-bit (June 2024) I have a table (data set) is about 60K records, and i need to create a new column to see which ID is removed by...
- 2 years ago
zenz - Instead of a column, you could create this as a measure. The DAX needs to change slightly, but the below should work for you:
VAR _id = SELECTEDVALUE ( 'Table (7)'[id] ) VAR next_date = SELECTEDVALUE ( 'Table (7)'[date] ) + 1 VAR current_date = SELECTEDVALUE ( 'Table (7)'[date] ) VAR id_next = CALCULATETABLE ( VALUES ( 'Table (7)'[id] ), REMOVEFILTERS ( 'Table (7)' ), 'Table (7)'[date] = next_date, 'Table (7)'[id] = _id ) VAR max_date = CALCULATE ( MAX ( 'Table (7)'[date] ), REMOVEFILTERS ( 'Table (7)' ) ) RETURN SWITCH ( TRUE (), _id IN id_next, 0, current_date = max_date, 0, NOT ( _id ) IN id_next, -1 )Screenshot below shows it's working for me:
If this works for you, please mark it as the solution.
- 2 years ago
zenz - Please remember to accept this as the solution, it helps others learning DAX find answers to their problems.
zenz
2 years agoFrequent Visitor
thank you so much. You are super start!.
This should solve another question I had for you. really apprecitate it!
mark_endicott
2 years agoSuper User
zenz - Please remember to accept this as the solution, it helps others learning DAX find answers to their problems.