Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All, im stuck with the follwing DAX command on my power query. I want to Days Passed to calculate the duration in days based on the status. If status is "complete" then calculate duration from date to date complete. if <> complete then calculate date to current date or Today.I
I get this error message
Expression.Error: 2 arguments were passed to a function which expects 1.
Details:
Pattern=
Arguments=[List]
this is my DAX
= Table.AddColumn(#"Extracted Month Name", "Days_Passed", each if [Status] = "Complete" then
Duration.Days([Date], [Date Closed]) else Duration.Days([Date], DateTime.LocalNow()))
Thanks in advance!
Solved! Go to Solution.
Hi!
Duration.Days expects one argument, a difference between two dates, so you need to use a minus sign instead of a comma there. You also need to convert DateTime.LocalNow() from DateTime to Date. Try something like:
= Table.AddColumn(#"Extracted Month Name", "Days_Passed", each if[Status] = "Complete" then Duration.Days([Date Closed]-[Date]) else Duration.Days(DateTime.Date(DateTime.LocalNow())-[Date]))
Hope this helps!
Hi!
Duration.Days expects one argument, a difference between two dates, so you need to use a minus sign instead of a comma there. You also need to convert DateTime.LocalNow() from DateTime to Date. Try something like:
= Table.AddColumn(#"Extracted Month Name", "Days_Passed", each if[Status] = "Complete" then Duration.Days([Date Closed]-[Date]) else Duration.Days(DateTime.Date(DateTime.LocalNow())-[Date]))
Hope this helps!
It works!!!
Thank you
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 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |