Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
23 | |
10 | |
10 | |
9 | |
7 |