Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I am having a hard time to get a expected output on a calculated column, i know how to get it through sql though using window function(lag). Here is the sql command:
select
(select lag(input_priority) over (partition by task_id order by task_id, request_datetime) as prv_input_priority
, input_priority
, convert(date, request_datetime) as dateField
from task_log
This will sort the data first on 'Task id' and then on 'request_datetime', after which will print the previous value of 'input_priority'.
On DAX i'm trying Earlier(), but having a very hard time to get the expected output.
Solved! Go to Solution.
HI @Anmol ,
Let me know if this works for you.
Create Calculated Columns
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Anmol
Can you show a sample of the table you are using and explain with an example based on that data/table what you would need?
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers
That's how the data looks like, im just looking for a calculated column that gives previous 'input_priority' only after sorting the data on 'task_id' and 'request_datetime'.
HI @Anmol ,
Let me know if this works for you.
Create Calculated Columns
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 13 | |
| 9 | |
| 8 | |
| 8 | |
| 7 |