Forum Discussion
LASTDATE Value LOOKUPVALUE
- 6 years ago
Hi RicLup
Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
Try this for the calculated column in the Total table:
EXR MXN = VAR LastDate_ = CALCULATE ( MIN ( 'Exchange Type'[Date Exchange Type] ), FILTER ( ALL ( 'Exchange Type' ), 'Exchange Type'[Desc Exchange Type] = Total[Desc Exchange] && 'Exchange Type'[Date Exchange Type] <= 'Total'[Date] ) ) RETURN CALCULATE ( DISTINCT ( 'Exchange Type'[Value Exchange Type] ), FILTER ( ALL ( 'Exchange Type' ), 'Exchange Type'[Desc Exchange Type] = Total[Desc Exchange] && 'Exchange Type'[Date Exchange Type] = LastDate_ ) )Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers

Hi RicLup
Please always show your sample data in text-tabular format in addition to (or instead of) the screen captures. A screen cap doesn't allow people to readily copy the data and run a quick test and thus decreases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).
Try this for the calculated column in the Total table:
EXR MXN =
VAR LastDate_ =
CALCULATE (
MIN ( 'Exchange Type'[Date Exchange Type] ),
FILTER (
ALL ( 'Exchange Type' ),
'Exchange Type'[Desc Exchange Type] = Total[Desc Exchange]
&& 'Exchange Type'[Date Exchange Type] <= 'Total'[Date]
)
)
RETURN
CALCULATE (
DISTINCT ( 'Exchange Type'[Value Exchange Type] ),
FILTER (
ALL ( 'Exchange Type' ),
'Exchange Type'[Desc Exchange Type] = Total[Desc Exchange]
&& 'Exchange Type'[Date Exchange Type] = LastDate_
)
)
Please mark the question solved when done and consider giving kudos if posts are helpful.
Cheers ![]()