Forum Discussion
K_LLI
5 years agoFrequent Visitor
Values from previous transaction date
Hi, I am trying to create DAX measures to get values from previous transaction dates. On left side is Transactions table where is should be able to calculate LTR and EUR values from previous tran...
- 5 years ago
Hi, K_LLI
I prefer to use calculated column as below:
C_Prvevious Eur = CALCULATE ( MAX ( Transactions[Eur] ), Transactions, Transactions[Date] < EARLIER ( Transactions[Date] ), Transactions[Project] = EARLIER ( Transactions[Project] ) )C_Prvevious Ltr = CALCULATE ( MAX ( Transactions[Ltr] ), Transactions, Transactions[Date] < EARLIER ( Transactions[Date] ), Transactions[Project] = EARLIER ( Transactions[Project] ) )You can also try measure as below:
M_Prvevious Eur = VAR previousdate = CALCULATE ( MAX ( Transactions[Date] ), FILTER ( ALLEXCEPT ( Transactions, Transactions[Project] ), Transactions[Date] < MAX ( Transactions[Date] ) ) ) RETURN CALCULATE ( MAX ( Transactions[Eur] ), FILTER ( ALLEXCEPT( Transactions,Transactions[Project]), Transactions[Date] = previousdate ) )M_Prvevious Ltr = VAR previousdate = CALCULATE ( MAX ( Transactions[Date] ), FILTER ( ALLEXCEPT ( Transactions, Transactions[Project] ), Transactions[Date] < MAX ( Transactions[Date] ) ) ) RETURN CALCULATE ( MAX ( Transactions[Ltr] ), FILTER ( ALLEXCEPT( Transactions,Transactions[Project]), Transactions[Date] = previousdate ) )Please check my attached pbix file for more details.
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
K_LLI
5 years agoFrequent Visitor
Hi,
I added date from transactions table and date from Date table to report and now it is shifting the calculation to next day (1.5.2020 -> 2.5.2020). The calculation should be shifted to next transaction date (1.5.2020 -> 4.5.2020) as shown in my first post. Can anyone help?
I have joined my calendar table to this transaction table and marked is as date table.
Thanks for the support amitchandak! do you find any solutions to this?