The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi All,
Could someone please help me recreate the below SQL into a DAX measure.
The SQL is returning the previous Actual Date from the previous ReportingDate Partitioned by the ProjectID and ProjectMilestoneID.
SELECT
P.ProjectID,
P.Actual,
P.ReportingDate,
P.ProjectMilestoneID,
LAG(P.Actual) OVER (
PARTITION BY P.ProjectID, P.ProjectMilestoneID
ORDER BY P.ReportingDate
) AS PreviousActual
FROM Project AS P
Here is the Output in SQL. I've highlighted one example at the bottom where project ID = 181 and Project Milestone ID = 3 it pulls back the previous actual date based on the previous reporting date
Sample Table:
ProjectID ActualDate ReportingDate Project Milestone ID
|
@CaveOfWonders Try to use OFFSET and INDEX dax.
User | Count |
---|---|
69 | |
68 | |
65 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
65 | |
48 | |
43 |