Forum Discussion

luxpbi's avatar
luxpbi
Helper V
7 years ago

Last year with 2 different dates

Hi all, 

 

I hope you can help me with a problem within I'm struggling for the last 2 months. 

 

My scenario: 
I have 1 fact table with 2 dates. 

Let's say that one date is order date and the other date is ship date. That means that I can have 5 order dates in January that will be shipped in the future, for example in February, march and June. 

 

What I need is to be able to filter by both dates and see all the time the measure compared with last year. 

I need Number by Order date. Number by Ship date, Number by Order date last year and Number by Ship date last year where Number is the number of distinctcount of products.

 

Dummy data:

Order dateShip dateProducts
02/01/201902/02/20191
03/01/201902/02/20192
03/01/201903/01/20191
02/01/201902/03/20193
02/01/201904/03/20194
04/01/201904/04/20195
02/01/201902/04/20196
02/01/201931/12/20197
02/01/201931/12/20198
04/01/201910/06/20199
04/01/201907/01/201910
02/01/201903/01/201911
02/01/201903/03/201912
03/01/201902/04/201913
03/01/201907/03/201914
03/01/201902/05/201915
03/01/201902/06/201916
04/01/201905/06/201917
04/01/201905/06/201918
05/01/201902/03/201919
04/01/201804/04/201820
02/01/201802/05/201821
03/01/201803/06/201822
04/01/201810/01/201823
04/01/201804/04/201824
02/01/201802/05/201825
04/01/201804/07/201826
02/01/201802/08/201827
05/01/201805/09/201828
03/01/201803/10/201829
02/01/201802/11/201830
04/01/201804/05/201831
01/01/201801/05/201832
01/01/201801/06/201833
01/01/201801/06/201834
05/01/201805/06/201835
06/01/201831/16/201836
01/01/201801/02/201837
01/01/201801/02/201838
06/01/201810/02/201839
04/01/201804/03/201840
04/01/201804/04/201841
06/01/201806/04/201842
03/01/201803/04/201843
03/01/201807/05/201844

 

Hope you can help me ! Thank you in advance !! 

2 Replies

  • v-xicai's avatar
    v-xicai
    Community Support

    Hi luxpbi ,

     

    >>What I need is to be able to filter by both dates and see all the time the measure compared with last year.

     

    I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

     

    Best Regards,

    Amy

    • luxpbi's avatar
      luxpbi
      Helper V

      Hi v-xicai ,

       

      I need Number by Order date. Number by Ship date, Number by Order date last year and Number by Ship date last year where Number is the number of distinctcount of products. And be able to filter by Order date and Ship date. 

       

      Thank you