Forum Discussion

MoMrCrane's avatar
MoMrCrane
Helper I
1 year ago
Solved

sales backlog

Hi,

 

I have an opportunity table from Salesforce and i'd like to see in the future how much in we expect to bill per customer and Job over time. Each customer(AccountID) has jobs (Job_Code__c) that we win. The Salesman_Estimate__c is how much we think we will make over the life of the job from start (Anticipated_Job_Start_Date) to finish (Anticipated_End_Date__c). We'd like to know on each day how much we plan to bill our customers. How can I map this over time?

 

AccountIdJob_Code__cAnticipated_Job_Start_Date__cAnticipated_End_Date__cSalesman_Estimate__c
0010Z00001wFVzXQAWG-3875912/10/2024 0:0012/10/2024 0:00$9,200
001i000000VTEbuAAHG-3885512/10/2024 0:0012/10/2024 0:00$6,000
001i000000VTFTAAA5R-3882312/10/2024 0:0012/10/2024 0:00$3,800
0010Z00002D0bYtQAJR-3802712/9/2024 0:0012/9/2024 0:00$50,000
0013r00002NHjfKAATG-3872612/9/2024 0:0012/19/2024 0:00$25,000
0013r00002ZaVPMAA3G-3625712/9/2024 0:0012/9/2024 0:00$12,000
001i000000VTFFsAAPT-3868612/9/2024 0:0012/10/2024 0:00$39,830
001Pg000002bjyFIAQG-3880912/9/2024 0:0012/20/2024 0:00$20,000
001Pg0000095zeFIAQG-3842512/9/2024 0:0012/21/2024 0:00$100,000
001Pg00000PLUO6IAPG-3870012/9/2024 0:0012/10/2024 0:00$15,000
001i000000VTFPCAA5W-3764912/8/2024 0:0012/12/2024 0:00$123,661
001Pg00000DWMzXIAXG-3880012/6/2024 0:0012/6/2024 0:00$3,500
0013r00002l2zknAAAG-3884912/5/2024 0:0012/5/2024 0:00$2,500
001i000000VTFefAAHBR-1220612/5/2024 0:001/1/2025 0:00$20,000
001i000001DK7l0AADG-3880412/5/2024 0:0012/20/2024 0:00$13,000
001Pg00000QJNoAIAXBR-1219312/5/2024 0:002/26/2025 0:00$70,000
001Pg00000QJNoAIAXBR-1219412/5/2024 0:002/26/2025 0:00$60,000
0010Z000028unnAQAQR-3882712/4/2024 0:0012/10/2024 0:00$15,000
001i000000VTFfxAAHW-3885812/4/2024 0:002/4/2026 0:00$427,812
001i000000VTFIHAA5G-3885412/4/2024 0:0012/4/2024 0:00$3,500
001i000000VTFILAA5G-3885312/4/2024 0:0012/5/2024 0:00$4,800
001Pg00000Abd0EIARG-3885912/4/2024 0:0012/4/2024 0:00$1,200
0010Z00001wFVzXQAWG-3875712/3/2024 0:0012/3/2024 0:00$9,200
001i000000VTELjAAPG-3886212/3/2024 0:0012/3/2024 0:00$4,000
001i000000VTFfxAAHW-3763712/3/2024 0:0012/6/2024 0:00$144,825
001i000000VTFfxAAHW-3855512/3/2024 0:0012/3/2024 0:00$30,000
001i000000VTGMcAAPG-3884612/3/2024 0:0012/4/2024 0:00$35,000
001Pg00000TiWeeIAFG-3884512/3/2024 0:0012/3/2024 0:00$5,000
001Pg00000U0F2gIAFG-3886312/3/2024 0:0012/3/2024 0:00$2,300

 

i've seen other posts like this one: https://community.fabric.microsoft.com/t5/Desktop/Calculating-Total-Project-Backlog-Per-Month/m-p/4266173#M1340414 but I would like mine per day. Even when I try to use the measures in this answer and do this by month, I get an error "cannot convert value of type Text to type Number" and I don't understand where that error is coming from. 

 

  • gmsamborn's avatar
    gmsamborn
    1 year ago

    Would something like this work?

     

    I added 2 columns to the fact table.

     

    Workdays = NETWORKDAYS( [Anticipated_Job_Start_Date__c], [Anticipated_End_Date__c] )
    
    PerDay = DIVIDE( [Salesman_Estimate__c], [Workdays] )

     

    Next I added these 2 measures.

     

    Job Value Dist. (inner) = 
    VAR _SelDt = MAX( 'Date'[Date] )
    VAR _WkDay = MAX( 'Date'[Working Day] )
    VAR _Result =
        IF(
            _WkDay = 1,
            CALCULATE(
                SUM( 'FactTable'[PerDay] ),
                FILTER(
                    ALLEXCEPT( 'FactTable', 'FactTable'[Job_Code__c] ),
                    'FactTable'[Anticipated_Job_Start_Date__c] <= _SelDt
                        && 'FactTable'[Anticipated_End_Date__c] >= _SelDt
                )
            )
        )
    RETURN
    	_Result

     

     

    Job Value Distribution = 
        SUMX(
            FILTER(
                'Date',
                'Date'[Working Day] = 1
            ),
            [Job Value Dist. (inner)]
        )

     

    Let me know if you have any questions.

     

4 Replies

    • MoMrCrane's avatar
      MoMrCrane
      Helper I

      Thanks for the reminder, i updated the original post. And i have some sample data below:

       

      AccountIdJob_Code__cAnticipated_Job_Start_Date__cAnticipated_End_Date__cSalesman_Estimate__c
      0010Z00001wFVzXQAWG-3875912/10/2024 0:0012/10/2024 0:00$9,200
      001i000000VTEbuAAHG-3885512/10/2024 0:0012/10/2024 0:00$6,000
      001i000000VTFTAAA5R-3882312/10/2024 0:0012/10/2024 0:00$3,800
      0010Z00002D0bYtQAJR-3802712/9/2024 0:0012/9/2024 0:00$50,000
      0013r00002NHjfKAATG-3872612/9/2024 0:0012/19/2024 0:00$25,000
      0013r00002ZaVPMAA3G-3625712/9/2024 0:0012/9/2024 0:00$12,000
      001i000000VTFFsAAPT-3868612/9/2024 0:0012/10/2024 0:00$39,830
      001Pg000002bjyFIAQG-3880912/9/2024 0:0012/20/2024 0:00$20,000
      001Pg0000095zeFIAQG-3842512/9/2024 0:0012/21/2024 0:00$100,000
      001Pg00000PLUO6IAPG-3870012/9/2024 0:0012/10/2024 0:00$15,000
      001i000000VTFPCAA5W-3764912/8/2024 0:0012/12/2024 0:00$123,661
      001Pg00000DWMzXIAXG-3880012/6/2024 0:0012/6/2024 0:00$3,500
      0013r00002l2zknAAAG-3884912/5/2024 0:0012/5/2024 0:00$2,500
      001i000000VTFefAAHBR-1220612/5/2024 0:001/1/2025 0:00$20,000
      001i000001DK7l0AADG-3880412/5/2024 0:0012/20/2024 0:00$13,000
      001Pg00000QJNoAIAXBR-1219312/5/2024 0:002/26/2025 0:00$70,000
      001Pg00000QJNoAIAXBR-1219412/5/2024 0:002/26/2025 0:00$60,000
      0010Z000028unnAQAQR-3882712/4/2024 0:0012/10/2024 0:00$15,000
      001i000000VTFfxAAHW-3885812/4/2024 0:002/4/2026 0:00$427,812
      001i000000VTFIHAA5G-3885412/4/2024 0:0012/4/2024 0:00$3,500
      001i000000VTFILAA5G-3885312/4/2024 0:0012/5/2024 0:00$4,800
      001Pg00000Abd0EIARG-3885912/4/2024 0:0012/4/2024 0:00$1,200
      0010Z00001wFVzXQAWG-3875712/3/2024 0:0012/3/2024 0:00$9,200
      001i000000VTELjAAPG-3886212/3/2024 0:0012/3/2024 0:00$4,000
      001i000000VTFfxAAHW-3763712/3/2024 0:0012/6/2024 0:00$144,825
      001i000000VTFfxAAHW-3855512/3/2024 0:0012/3/2024 0:00$30,000
      001i000000VTGMcAAPG-3884612/3/2024 0:0012/4/2024 0:00$35,000
      001Pg00000TiWeeIAFG-3884512/3/2024 0:0012/3/2024 0:00$5,000
      001Pg00000U0F2gIAFG-3886312/3/2024 0:0012/3/2024 0:00$2,300
      • gmsamborn's avatar
        gmsamborn
        Super User

        Would something like this work?

         

        I added 2 columns to the fact table.

         

        Workdays = NETWORKDAYS( [Anticipated_Job_Start_Date__c], [Anticipated_End_Date__c] )
        
        PerDay = DIVIDE( [Salesman_Estimate__c], [Workdays] )

         

        Next I added these 2 measures.

         

        Job Value Dist. (inner) = 
        VAR _SelDt = MAX( 'Date'[Date] )
        VAR _WkDay = MAX( 'Date'[Working Day] )
        VAR _Result =
            IF(
                _WkDay = 1,
                CALCULATE(
                    SUM( 'FactTable'[PerDay] ),
                    FILTER(
                        ALLEXCEPT( 'FactTable', 'FactTable'[Job_Code__c] ),
                        'FactTable'[Anticipated_Job_Start_Date__c] <= _SelDt
                            && 'FactTable'[Anticipated_End_Date__c] >= _SelDt
                    )
                )
            )
        RETURN
        	_Result

         

         

        Job Value Distribution = 
            SUMX(
                FILTER(
                    'Date',
                    'Date'[Working Day] = 1
                ),
                [Job Value Dist. (inner)]
            )

         

        Let me know if you have any questions.