Forum Discussion

Guyakobov's avatar
Guyakobov
Helper II
7 years ago

' AND' option between 2 dates columns

HI,

 

I have 2 tables, one is accounts and their 'creation' date and the other is account's transactions and the approval date of each transaction.

 

I would like to calculate the sum of transactions of accounts that created and their transaction approved in the date range that ill choose.

 

in simple code it's like this: 

 

date(mt.Lv_ApprovedOn) between date(date_range_start) and date(date_range_end)  and date(ac.createdon) between date(date_range_start) and date(date_range_end)

 

Thanks 

 

 

5 Replies

    • Guyakobov's avatar
      Guyakobov
      Helper II

      HI,

       

      You can see in the table attached (http://prntscr.com/msjsfn)  that we have an account ('lv_account') and we can see all of his transactions ('count') and their approval date ('lv_approvedon'). in the last column ('deposit reg.createdon') we have the date that the accounts were created.

       

      I want to choose, for example, July data, and I would like to receive all the accounts that were created on July and get their transactions in that same time frame that I choose ( July in our example).

       

      The transactions that supped to appear are highlights in the picture.

       

      Regards  

    • Guyakobov's avatar
      Guyakobov
      Helper II

      HI,

       

      The data sample is here https://prnt.sc/msjsfn - you can see in that table that we have one account that was created in July and did a few transactions in July and more transactions after. so, if ill choose in my date filter all of July I suppose to see only the accounts that were created ON July and the transaction that was approved on July cause this is the time frame that I chose.

       

      and i want it to be like this http://prntscr.com/mt30le 

      • v-piga-msft's avatar
        v-piga-msft
        Resident Rockstar

        Hi Guyakobov ,

         

        Based on your information, it seems that you have a slicer and you want to show the sum of count based on the selected month?

         

        If it is, I'm afraid that you just create the measure like below and then you will get the result.

         

        Measure = CALCULATE(SUM('Table1'[Count]),ALLSELECTED(Table1))

         

        If you still need help, please share more sample data which could reproduce your scenario so that we can help further on it.

         

        Best  Regards,

        Cherry