Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Using two date slicers on a dataset to create one visual

I have a dataset like below

 

Doc DateDoc TypeDoc NumInvoice datePayment dateCustomerDebit $Credit $
01-Jun-22InvoiceD101-Jun-22 C11000 
10-Jun-22InvoiceD210-Jun-22 C1500 
15-Jun-22PaymentD3 15-Jun-22C1 100
17-Jun-22PaymentD4 17-Jun-22C1 200
20-Jun-22InvoiceD520-Jun-22 C12000 
23-Jun-22InvoiceD623-Jun-22 C11500 
29-Jun-22InvoiceD729-Jun-22 C13000 
03-JulPaymentD8 03-JulC1 2000
08-Jul-22PaymentD9 08-Jul-22C1 1000
15-Jul-22PaymentD10 15-Jul-22C1 1500

 

Problem statement:

I need to make one visual with two slicers - Invoice date and payment date, which will show the invoices and payments for the corresponding periods. For example, if I choose invoice date as 01-Jun to 30-Jun and payment date as 01-Jun to 15-Jul, then the following result should be displayed - All invoices within the invoice date range and all payments in the payment date range.

 

 

Basically I would have two different date filters on the same table. How do I go about doing this.

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    In addintion to Greg_Deckler's reply, I suggest you to create unrelated date tables and use measure to filter your measure.

    Invoice date = CALENDARAUTO()
    Payment date = CALENDARAUTO()

    Measure:

    Measure = 
    VAR _Invoice_date = VALUES('Invoice date'[Date])
    VAR _Payment_date = VALUES('Payment date'[Date])
    RETURN
    IF(MAX('Table'[Invoice date]) IN _Invoice_date ||MAX('Table'[Payment date]) IN _Payment_date,1,0)

    Add this measure into your table visual and set it to show items when value =1.

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    In addintion to Greg_Deckler's reply, I suggest you to create unrelated date tables and use measure to filter your measure.

    Invoice date = CALENDARAUTO()
    Payment date = CALENDARAUTO()

    Measure:

    Measure = 
    VAR _Invoice_date = VALUES('Invoice date'[Date])
    VAR _Payment_date = VALUES('Payment date'[Date])
    RETURN
    IF(MAX('Table'[Invoice date]) IN _Invoice_date ||MAX('Table'[Payment date]) IN _Payment_date,1,0)

    Add this measure into your table visual and set it to show items when value =1.

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.