Forum Discussion
Filtering a table on the Max date by department
- 7 months ago
Thank you everyone for examples and assistance - appreciate it.
I ended up doing the following:
- Sort by Department (Ascending) then by date (Decending - putting the most recent date first)
- Adding ranking logic by Department
- The result is the most recent date results in a ranking of 1 for each departmnt
- Filter on the 1 Ranking
As the data dynamically updates, I will always get the most recent date.
Thanks - Jerry
Hi,
You can also do this only in Power BI.
Hi - I like this method, but I need create a column in the Power BI Workflow (power query) in the table itself.
I add a column and enter this code in the 'custom column formula' - got an error - any thoughts ?
- ronrsnfld8 months agoSuper User
your syntax for ALLEXCEPT is wrong. You need to show the Table and the Column as arguments:
ALLEXCEPT('Table','Table'[DEPARTMENT])- jerryr1257 months agoHelper IV
Thank you again for your help - update:
Table: Department-KPI-Table
Columns: KPIDATE (Date)
DEPARTMENT (Text)New column:KPIMaxDate
Datatype: I Kept this blank but wants to convert to textFormula:
CALCULATE (
MAX ([KPIDATE]),
ALLEXCEPT(Department-KPI-Table,Department-KPI-Table[DEPARTMENT])
)Result: all null when I convert to Text
Seems like I am getting close - any thoughts ?
Your help is appreciated - Jerry