Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
hi all,
I have the following question about below table.
As you can see there are muliple rowes with the same container nr, but with different order dates ans status codes:
container_nr | status_cod | order_dat |
SUDU5168064 | 113 | 26-7-2018 |
SUDU5168064 | 110 | 17-8-2018 |
SUDU5168064 | 115 | 7-6-2018 |
SUDU5168064 | 100 | 8-9-2017 |
APRU5773334 | 110 | 12-10-2016 |
APRU5773334 | 115 | 20-12-2016 |
I need a formula/ filter which gives me only the container number with the most recent order date.
So, the result of the formula/ filter gives me only one row per container nr. (as shown below).
Thanks! John
container_nr | status_cod | order_dat |
SUDU5168064 | 110 | 17-8-2018 |
APRU5773334 | 115 | 20-12-2016 |
Solved! Go to Solution.
Hey,
I created a calculated column in your table using this DAX statement like so:
most recent = var thisContainer = 'Table2'[container_nr] var lastDateByContainerNr = CALCULATE( MAX('Table2'[order_dat]) ,FILTER( ALL('Table2') ,'Table2'[container_nr] = thisContainer ) ) return IF('Table2'[order_dat] = lastDateByContainerNr, "yes", "no")
This leads to this table:
Now you can use the column "most recent" to filter your data.
Hopefully this is what you are looking for!
Regards,
Tom
Hey,
I created a calculated column in your table using this DAX statement like so:
most recent = var thisContainer = 'Table2'[container_nr] var lastDateByContainerNr = CALCULATE( MAX('Table2'[order_dat]) ,FILTER( ALL('Table2') ,'Table2'[container_nr] = thisContainer ) ) return IF('Table2'[order_dat] = lastDateByContainerNr, "yes", "no")
This leads to this table:
Now you can use the column "most recent" to filter your data.
Hopefully this is what you are looking for!
Regards,
Tom
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
96 | |
93 | |
82 | |
70 | |
64 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |