Forum Discussion

Kacper3's avatar
Kacper3
New Member
1 year ago
Solved

Data from previous years not appearing when filtering

My issue is the data is inaccurate when I filter by date.

Context

The report shows:

  • The total won projects (This is based on dealstage = "Closed - Won")

  • Total quotes submitted (I'm using the original quote date to stamp that the project has been through the quote stage. The projects move out of the quote stage and update, so using "Dealstage" will be inaccurate)

  • Then I'm dividing both to get a conversion rate.

I've tried using the original quote date for filtering but there's project's quoted in 2023 that aren't appearing in the won projects measure.

When I filter by close date, it only shows me a total of projects that have a close date and original quote date, either won or lost. 

 

My goal is to display a conversion rate and total projects won each year while displaying projects we've won even if they've been quoted in 2023. 

 

Here's my measures:

06 - Total Win = 

CALCULATE(COUNTROWS('result_deals'),
'result_deals'[dealstage] = "Closed - Won"
)


03 - ConversionRate = 
DIVIDE(
[06 - Total Win], [20 - Total_QS]
) 20 - Total_QS = CALCULATE(     COUNTROWS('result_deals'),     NOT(ISBLANK('result_deals'[original_quote_date])) || result_deals[dealstage] = "Quote Submitted" )

What can I do differently?

 

Thanks

  • I managed to solve the issue. 

    I create a new column that will chose the relevant date. If the project has been closed - won, it will take the date from closedate column otherwise use original_quote_date. 

    Relevant_Date = 
    IF('result_deals'[dealstage] = "Closed - Won",
        'result_deals'[closedate],
        'result_deals'[original_quote_date]
    )


    I'm using the above column for filtering and using the relevant date column as the date slicer. 

5 Replies

  • Hello Kacper3,

     

    Can you please try this:

    06 - Total Win = 
    CALCULATE(
        COUNTROWS('result_deals'),
        'result_deals'[dealstage] = "Closed - Won"
    )
    
    20 - Total_QS = 
    CALCULATE(
        COUNTROWS('result_deals'),
        OR(
            NOT(ISBLANK('result_deals'[original_quote_date])),
            'result_deals'[dealstage] = "Quote Submitted"
        )
    )
    
    03 - ConversionRate = 
    DIVIDE(
        CALCULATE(
            [06 - Total Win],
            'result_deals'[CloseYear] = SELECTEDVALUE('Calendar'[Year])
        ),
        CALCULATE(
            [20 - Total_QS],
            'result_deals'[QuoteYear] = SELECTEDVALUE('Calendar'[Year])
        )
    )
    
    QuoteYear = YEAR('result_deals'[original_quote_date])
    
    CloseYear = YEAR('result_deals'[close_date])
  • Hi,

    Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.

  • Hi Kacper3 

    While measures can contain aggregates outside the selected range, the way filters from a related or the same table work is that it shows only the rows based on what's been selected such that if you select 2024, it will show just all 2024rows. You can either change the numeric slicer to before and reference the max year in your measure or use a disconnected table to show even those that are not from the current year using still by referencing it in a measure.

  • Sahir_Maharaj danextian Ashish_Mathur 

    I've tried both solutions but they still don't seem to work. 

    I've tried creating a centralized date table and making the active relationship to original quote date but it's still not working. 

    Due to data privacy and working with real information, below is sample of my data (it's not allowing me upload a CSV file) 

     

    I have highlighted project 12 an example. 

     

    The goal is to create a conversion rate of quotes submitted to projects won. Then, in a line graph display and card visual show the total projects won and projects quoted. Finally, use a date slicer to narrow down and see the total project won and quoted in a set period (Year, QTR, and Month) 

     

    ProjectNamedeal_currency_codecreatedateCountryCO#closed_lost_reasonclosedatedealstagedel_startorder_dueoriginal_quote_dateSum of unit_amount
    project 2EUR16/04/2024 12:51IRE29373323412 14/11/2024 15:15Closed - Won01/04/2025 00:0001/01/2025 00:0007/05/2024 00:0065
    project 3EUR27/09/2024 09:52IRE29382040502 29/11/2024 12:33Closed - Won03/03/2025 00:0004/11/2024 00:0018/10/2024 00:00461
    project 4EUR17/06/2024 12:58IRE29385007545 29/11/2024 15:06Closed - Won01/05/2025 00:0001/11/2024 00:0009/07/2024 00:00146
    project 5GBP29/01/2024 09:12UK29343585074Project Cancelled12/12/2024 12:01Closed - Lost 19/02/2024 00:00271
    project 6GBP04/03/2024 09:01UK29363593221Project Went Traditional12/12/2024 15:26Closed - Lost 25/03/2024 00:00111
    project 7EUR03/12/2024 15:53IRE29794206393  Waiting Response 23/02/2023 00:00154
    project 8GBP01/02/2023 12:26UK29355474285  Quote Submitted 23/02/2023 00:00272
    project 9GBP03/02/2023 12:05UK29700203912  Quote Submitted 24/02/2023 00:00645
    project 10EUR04/02/2023 12:55IRE29377504819  Quote Submitted 25/02/2023 00:00164
    project 11GBP08/01/2024 14:56UK30231210568Competitors01/02/2024 14:56Closed - Lost 25/01/2024 00:00333
    project 12EUR20/11/2023 16:11IRE30362596895 28/02/2024 16:14Closed - Won03/06/2024 00:00 11/12/2023 00:00689
    project 13EUR08/04/2024 10:41IRE29762598472Project Went Traditional30/04/2024 15:03Closed - Lost02/09/2024 00:00 29/04/2024 00:00538
    project 14EUR01/02/2024 10:47IRE29675180097 31/05/2024 12:29Closed - Won02/09/2024 00:00 22/02/2024 00:00107
    project 15EUR22/08/2024 12:45IRE29679128651 15/06/2024 12:26Closed - Won03/06/2024 00:00 12/09/2024 00:00213
    project 16GBP09/04/2024 10:47UK29674186626 01/07/2024 12:18Closed - Won03/03/2025 00:00 30/04/2024 00:00207
    project 17EUR14/05/2024 10:36IRE29675181415 25/09/2024 15:14Closed - Won01/05/2025 00:00 04/06/2024 00:00183
    project 18EUR09/05/2024 12:45IRE29679125549 08/10/2024 15:16Closed - Won01/10/2024 00:00 30/05/2024 00:00173
  • I managed to solve the issue. 

    I create a new column that will chose the relevant date. If the project has been closed - won, it will take the date from closedate column otherwise use original_quote_date. 

    Relevant_Date = 
    IF('result_deals'[dealstage] = "Closed - Won",
        'result_deals'[closedate],
        'result_deals'[original_quote_date]
    )


    I'm using the above column for filtering and using the relevant date column as the date slicer.