Forum Discussion
rnnguyen
4 years agoRegular Visitor
DAX Measure finding MAXDATE
Hello All,
I need your help! I've created a measure to pick up the latest CreateTimeStamp date but it summed up the total because the dates are the same. I think it needs another MAX InvoiceKey in the measure to calculate
| InvoiceKey | Total | CreateTimestamp | SupplierConnectInvoiceKey | vendor_id | InvoiceDetailsKey | InvoiceNumber | ||
| 2230 | 31.25 | 7/20/2022 | 17840 | CIV001 | 2223 | 77235 | ||
| 2230 | 500 | 7/20/2022 | 17840 | CIV001 | 2223 | 77235 | ||
| 2230 | 56.25 | 7/20/2022 | 17840 | CIV001 | 2223 | 77235 | ||
| 2230 | 900 | 7/20/2022 | 17840 | CIV001 | 2223 | 77235 | ||
| 2262 | 31.25 | 7/20/2022 | 18066 | CIV001 | 2255 | 77235 | ||
| 2262 | 500 | 7/20/2022 | 18066 | CIV001 | 2255 | 77235 | ||
| 2262 | 56.25 | 7/20/2022 | 18066 | CIV001 | 2255 | 77235 | ||
| 2262 | 900 | 7/20/2022 | 18066 | CIV001 | 2255 | 77235 |
CurrentDate =
VAR a =
CALCULATE(
MAX('public AggregateCoding'[CreateTimestamp]),
ALLEXCEPT('public AggregateCoding','public AggregateCoding'[InvoiceNumber])
)
RETURN
IF(a = SELECTEDVALUE('public AggregateCoding'[CreateTimestamp]),1,0)
2 Replies
- lbendlinSuper User
Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?
- v-yanjiang-msftCommunity Support
Hi rnnguyen ,
Sorry not clear about your expected result. Your formula will return 1 for all rows, isn't it right?
Looking forward to your reply.
Best Regards,
Community Support Team _ kalyj