Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Advanced if statement and dates

I am trying to make a statement for every month that will determine if we should bill our company or not; and if so the amount of total workable hours per month or if the employee has submitted hours the amount of hours submitted.

 

For example:
If the PO starts on 9/1/18 then we would bill the normal 152 workable hours unless the employee has submitted their hours. Then we would want to bill their submitted hours.

 

If the PO ends before 8/31/19 then we would not want to bill for any month’s after the contract end date they submitted hours worked.

        So if the employee’s PO ends on 3/1/19 then we would bill up to that point but not after unless hours have been submitted.

 

Finally this needs to be done for every month but also keep a running record of the amount of PO hours available after being billed.

 

So if the employee has 2080 hours to work on the entire PO, and September has already passed and they submitted 160 hours to the PO then we would want October to be 1920-Est Billed Hours.

        So Sept Remaining Hours = Initial PO (2080) – Sept Hours (160) = (1,920)  

        Oct Remaining Hours = (Sept Remaining Hours (1920)) – Oct hours (152) = (1,768)

 

The Hours per month would either be the amount of workable hours per employee (assuming full month’s hours submitted) or the amount of hours they have submitted per their contract. So we don't want to bill hours before a contract start date and we don't want to bill hours (unless hours are worked) after a contract end date.

 

I am running into the issue of combining the two if statements for the start and end date to properly bill for each month. Please let me know if you have any questions. 

7 REPLIES 7
Anonymous
Not applicable

can you post some sample data?  SWITCH is going to be your friend in these types of situations 

Anonymous
Not applicable

Sure, I cannot seem to find a way to attach the excel or pbi file though, how would I do this? I will also note I need this contained in a single formula; this is due to business / report requirements. 

Anonymous
Not applicable

Dropbox or one drive link is good

Anonymous
Not applicable

Let me know if that download link does not work, I can always email the excel file to you directly. Thanks for the help in advance by the way.

Anonymous
Not applicable

anychance you can add some dummy data in that file and what you'd expect the outcome to be?  I took a look and its still a little unclear.

Anonymous
Not applicable

I have uploaded a new version with some notes in it, let me know if that is still unclear. 

Anonymous
Not applicable

Please use this link to download the example file.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.