Forum Discussion

luzsoulez's avatar
luzsoulez
Icon for Helper I rankHelper I
4 years ago
Solved

Weekly Gross Profit by project

Hi,

I have the following problem, we work with projects, therefore they have a start and an end date. I want to see the profit by week of each project.

person XXX starts 10/02/2020 and finishes the project on 06/13/2022 - GP per day 30USD

person XXX2 starts 08/02/2022 and finished the project on 05/05/2022 - GP per day 50USD

I want to be able to see the GP  by week making sure the project GP comes in/out correctly and accounts for only Monday-Friday, some projects can start/end mid-week.

This is what I have used for the following daily view, but it does not work for weekly totals

Formula 1

Formula 2

The final formula for visualization

#grossprofit #weeklycalc

Any ideas? Thanks!

Luz

9 Replies

    • luzsoulez's avatar
      luzsoulez
      Icon for Helper I rankHelper I

      Thanks for the article is really good but still does not help me to resolve my current issue because I don't have a transaction per day. I have a transaction that starts one day and ends in the future and I need to show how it rolls through that entire period of time. let's forget about the week concept, if the project is active through one month I need to see the daily GP every day, although I don't have 1 line per day, I only have a starting point and an endpoint. after accomplishing that I can aggregate it into weeks, months, etc..

    • luzsoulez's avatar
      luzsoulez
      Icon for Helper I rankHelper I

      Hi! sorry for the delay I was OOO last week. Thanks for any help you can provide

      Please see a sample of the data below (I can't attach it). Ideally, the calculation is the Gross profit per day and aggregates to weeks to account for projects that start/end mid-week.

      idStatusStart DateEnd DateBurdenLoaded PayrateGross Profit HourGross Profit weekGross Profit Day
      452696Approved8/30/20218/27/20221.17$67.30$25.36$1,014.20$202.84
      448983Approved6/28/202112/31/20221.17$68.30$12.53$501.08$100.22
      458540Approved12/27/202112/26/20221.05$86.10$25.70$1,028.00$205.60
      457511Approved11/8/202112/31/20221.26$75.60$19.22$768.80$153.76
      457421Approved11/8/202112/31/20221.26$73.70$17.30$692.00$138.40
      456710Approved11/22/202112/31/20221.17$62.30$20.02$800.70$160.14
      454331Approved9/27/202110/31/20221.17$76.10$22.26$890.40$178.08
      450699Approved8/16/202110/30/20221.17$72.00$18.05$721.80$144.36
      448293Approved6/14/202112/13/20221.17$83.10$24.69$987.60$197.52
      445811Approved4/26/202112/31/20221.17$47.90$8.29$331.48$66.30
      445060Approved5/17/202112/30/20221.26$75.60$15.63$625.20$125.04
      444756Approved4/7/202112/31/20221.05$63.00$24.00$960.00$192.00
      442322Approved3/4/20218/31/20221.05$63.00$21.00$840.00$168.00
      434904Approved11/30/202010/30/20221.17$81.90$10.10$404.00$80.80
      431472Approved9/21/202010/30/20221.17$67.90$17.07$682.80$136.56
      425936Approved4/27/202010/26/20221.17$79.60$7.55$302.00$60.40
      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        I cannot understand which there are the input columns and which are the output columns?  You already have Gross profit per day - what else do you want?  As requested earlier, share a Calendar table in the PBI file with a column of week number.  Please also show the expected result clearly.

  • Hi,

    Ideally there should be a 1 row per date and there is a way to do this in the Query Editor.  However, this will increase the number of rows in the source data table.  If you are OK with using this approach, then share the download link of your PBI file.  Also, ensure there is a Calendar table in that file with a column of week number. 

    • luzsoulez's avatar
      luzsoulez
      Icon for Helper I rankHelper I

      Hi, I understand what you mean, one line per transaction, I am not worried about the number of lines. can I generate the rows in the query if I have a start date and an end date to create all the rows in between? that would be the only way as the database does not have one line per day per person.

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Hi,

        Yes, it can be done.  Share data in a format that can be pasted in an MS Excel file.