Forum Discussion

clemente's avatar
clemente
Copper Contributor
Mar 25, 2025

Using DAX or Power BI to select rows according to specific rules

Hi everybody,

I have an Excel table showing stock values at different dates like this:

WKNIDDateThresholdCoupon Payment
LB3MZU0000117-mai-2024€ 5,60€ 66,00
LB3MZU0000216-mai-2025€ 5,60€ 66,00
LB3MZU0000315-mai-2026€ 5,60€ 66,00
LB3MZU0000421-mai-2027€ 5,60€ 66,00
LB3MZU0000519-mai-2028€ 5,60€ 66,00
LB3MZU0000618-mai-2029€ 5,60€ 66,00
DDZ0TQ0000730-nov-2023€ 39,95€ 30,00
DDZ0TQ0000802-dez-2024€ 39,95€ 30,00
DDZ0TQ0000901-dez-2025€ 39,95€ 30,00
DDZ0TQ0001030-nov-2026€ 39,95€ 30,00
DDZ0TQ0001130-nov-2027€ 39,95€ 30,00
DDZ0TQ0001230-nov-2028€ 39,95€ 30,00
DW7H490001310-jul-2024€ 115,50€ 35,00
DW7H490001410-jul-2025€ 115,50€ 35,00
DW7H490001510-jul-2026€ 115,50€ 35,00
DW7H490001612-jul-2027€ 115,50€ 35,00
DW7H490001710-jul-2028€ 115,50€ 35,00
DW7H490001810-jul-2029€ 115,50€ 35,00
 

   Is there a way using DAX or Power Query to select rows of unique WKNs (Column A) showing the only the most distant date (or the biggest ID)? The result I would like to achieve is:

WKNIDDateThresholdCoupon Payment
LB3MZU0000618-mai-2029€ 5,60€ 66,00
DDZ0TQ0001230-nov-2028€ 39,95€ 30,00
DW7H490001810-jul-2029€ 115,50€ 35,00
 

Thank you in advance!

 

Resources