Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hello everyone,
i need your help in writing a DAX Formula that returns distinct values for a row, based on max date that is smaller or equal to the value chosen in a slicer.
So i have a DataTable which is being loaded every day with new rows that have been updated. As you can see every change in the customer data is updated, by adding a new row with new loadtime.
Example:
Customer | Name | Postal Code | Loadtime |
XXX | John | 555 555 | 22.02.2023 |
XXX | John | 666 666 | 20.02.2023 |
YYY | Elisabeth | 444 444 | 22.02.2023 |
YYY | Emma | 444 444 | 15.02.2023 |
ZZZ | Jules | 111 111 | 11.02.2023 |
So if i choose a DATE with a SLICER : 22.02.2023
I want to get is a table that looks like this:
Customer | Name | Postal Code | Loadtime |
XXX | John | 555 555 | 22.02.2023 |
YYY | Elisabeth | 444 444 | 22.02.2023 |
ZZZ | Jules | 111 111 | 11.02.2023 |
but if i change the slicer value to : 11.02.2023
i want a table to look like this:
Customer | Name | Postal COde | Loadtime |
ZZZ | Jules | 111 111 | 11.02.2023 |
I have tried different formulas but was unfortunately not successful. Would apperciate your help.
Best Regards
yes
Try by placing the following measure in the filter pane of the table visual and select "is" (1) then apply the filter
FilterMeasure =
INT (
MAX ( DataTable[Loadtime] )
= CALCULATE (
MAX ( DataTable[Loadtime] ),
ALLEXCEPT ( DataTable, DataTable[Name] ),
'Date'[Date] <= MAX ( 'Date'[Date] )
)
)
hi @CarMechanic
hello @FreemanZ ,
thanks for the fast response.
Unfortunately this solution doesnt cover all the changes that can happen in a row. The tables i have posted are only examples. The real data rows consist of 30 columns with different attributes. Whenever one of the attributes changes, a new row with new loadtime will be added for a customer. So the solution must be more flexible than that. But thanks 🙂
User | Count |
---|---|
13 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
28 | |
19 | |
13 | |
11 | |
7 |