Forum Discussion
Getting a single column value based on another (unique) column value - Optimize
Thanks for the reply, amitchandak!
The statement works indeed as expected. I'm just looking to see if I can optimize it. I find it weird I have to use a calculate' and 'MAX' (or maxx), if I just want to return a single value from a table where I know I'm not looking at a range of data but just a single row.
Sample data is very basic. It looks something like this. I just want to get the corresponding 'dashboard_endDate' for the current date so that I can automatically update data in my dashboard. (I can't use a relative date slicer for example, because information of the previous month can only be shown 'x' working days after the new month starts).
| Date | dashboard_endDate |
| 2021-06-01 | 2021-04-30 |
| 2021-06-02 | 2021-04-30 |
| 2021-06-03 | 2021-04-30 |
| 2021-06-04 | 2021-05-31 |
| 2021-06-05 | 2021-05-31 |
| 2021-06-06 | 2021-05-31 |
This might just be the way PowerBI/DAX works and I'm overthinking things. If that's the case, I'll stop looking for another solution.