March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I have 2 Fact Tables, FactA and FactB. FactB needs to get info from FactA. Both FactA and FactB can connect via PayerKey. In FactA, there is DateKey, referring to reportingdate. In FactB, the Datekey is referring to OrderDate.
I want to create a calculated column in FactB, that gets the [Measure] which logic is from FactA, where datekey in FactA is the latest date in FcatA.
Current formula I used is as below, but it is wrong:
var latestdate = MAX(FactB[DateKey])
return
IF(
CALCULATE([Measure], USERELATIONSHIP(vw_FactB[PayerKey], vw_DimPayer[PayerKey]),vw_FactA[DateKey]=latestdate) = BLANK(), 0,
CALCULATE([Measure], USERELATIONSHIP(vw_FactB[PayerKey], vw_DimPayer[PayerKey]),vw_FactA[DateKey]=latestdate)
)
Please help 🙂
Solved! Go to Solution.
Hi everyone,
I tried to use this formula and apparently it works!
Hi everyone,
I tried to use this formula and apparently it works!
Hi, @kilala
There are no syntax errors from the current formula.
Is there any other specific error message?
Best Regards,
Community Support Team _ Eason
Hi @kilala ,
When you refer to t eh MAX date your context since it's on a table it will pick up the current line context so your line will return the exact value, is that the intedend result?
Can you please share a mockup of your data?
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsMarch 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |