Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi guys!
I would like help me with my Dax Formula. I need to bring the LASTDATE Value in the Exchange Type Table toward another Table called Total.
I´ve been used LOOKUPVALUE to compare the distinct parameters But my problem is that only bring when the Date is the same in the two tables and I need the LASTDATE Value found.
My Formula:
EXR MXN =
LOOKUPVALUE (
'Exchange Type'[Value Exchange Type],
'Exchange Type'[ExchangeType.De], Total[Desc Exchange],
'Exchange Type'[Date Exchange Type].[Date], LASTDATE (
(
FILTER (
ALL ( 'Exchange Type'[Date Exchange Type] ),
'Exchange Type'[Date Exchange Type] <= Total[Date]
)
)
)
)
My table Exchange Type
My table Total and the results empty:
I can´t bring the value when the Date in Exchange Type is in the past respect for the DATE in Total Table.
Regards and thanks!
Solved! Go to Solution.
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
Thanks a lot @AlB, the formula works perfect and Im gonna take your tips for the next posts.
Regards!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |