Forum Discussion
MAX date
- Anonymous2 years ago
Hi JolienR ,
Please try:LastOrderDate = VAR __table = CALCULATETABLE ( ADDCOLUMNS ( SUMMARIZE ( 'Table', 'Table'[CustomerID], 'Table'[ColumnName1], //2021 'Table'[ColumnName2] //kwartaal2&kwartaal3 ), "date", [OrderDates12-6Months] ), ALLSELECTED ( 'Table'[ColumnName2] ) ) VAR _lastdate = MAXX ( __table, [date] ) RETURN _lastdateOutput:
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Try the following:
CALCULATE(MAX('YourTable'[LastOrderDate]), FILTER(ALL('YourTable'),
'YourTable'[CustomerID] = SELECTEDVALUE('YourTable'[CustomerID])
'YourTable'[OrderDate] <= MAX('YourTable'[MainDateField])
)
This effectively removes the row level filter context, then reapplies the filter context for the specified fields, in this case: CustomerID is the same as in the table; Order Date is within the range selected in the slicer. Hope this helps, let me know if you have any questions or issues.