Forum Discussion
Get latest date values
- Anonymous1 year ago
Hi RafaelAri ,
Thanks for all the replies!
And RafaelAri , I think rajendraongole1's reply is close, so I modified his response a bit:
Here is my sample data:
I changed his DAX into this:Latest_Qty_With_Status_1 = VAR _RecentDate = CALCULATE( MAX('Table'[Status Date]), FILTER( ALL('Table'), RIGHT('Table'[Status], 2) = "\1" && 'Table'[Item] = MAX('Table'[Item]) ) ) RETURN CALCULATE( SUM('Table'[Qty.]), ALL('Table'), RIGHT('Table'[Status], 2) = "\1" && 'Table'[Item] = MAX('Table'[Item]) && 'Table'[Status Date] = _RecentDate )And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi RafaelAri - you can create a measure that identifies the latest entry for each item with a status ending in "\1" and then sums the quantity for those entries.
write dax logic as below:
Latest_Qty_With_Status_1 =
VAR LatestDatePerItem =
CALCULATE(
MAX('Table'[Status Date]),
FILTER(
'Table',
RIGHT('Table'[Status], 2) = "\1"
)
)
RETURN
SUMX(
FILTER(
'Table',
RIGHT('Table'[Status], 2) = "\1" &&
'Table'[Status Date] = LatestDatePerItem
),
'Table'[Qty]
)
you can change 'Table' with the actual name of your table in Power BI.
Hope this logic helps.
- RafaelAri1 year agoHelper III
Thanks, this is helpful, I'm trying to use this solution