Forum Discussion

renlaforest's avatar
renlaforest
Helper I
4 years ago
Solved

Target to date

Hello - I'm new to Power BI and DAX. I've strugged with figuring out the following.

I have a start date for the project and a close date, and I created a column to calculate the total number of days. 

I've also got a total target column for those dates. If the total target is 1000, and yesterday was half way through the start and close dates, I'd like the target to be 500. If today's after the close date, I'd like the target to be 1000. For clarify, if today's the close date, and the project is open for 10 days, I'd like the target to be 900.

In the example above, the target shouldn't be 3288 - it should be 1644 since we're half way through the dates that the project is open.

Thank you in advance for your help!

  • Hi, renlaforest 

     

    This error shows that you are using the custom column feature in powerquery.

    But the code is DAX, not M code. You need to create it in desktop.

     

    Best Regards,
    Community Support Team _ Janey
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

7 Replies