Forum Discussion

Dave93's avatar
Dave93
Frequent Visitor
9 years ago
Solved

Handling two different dates on the Axis

Hi,

 

Could someone help me with the following. I want to show for every month the total amount of invoices compared to the total amount of paid invoices. 

 

To calculate the total amount of invoices I use the measure SUM('Invoice Headers'[InvoiceAmt] and for the total amount of the paid invoices I use the measure SUM( 'Payment Behaviour'[PaymentAmount]. 

 

When I make for example a barchart, I add the "Month of Year" (maand van jaar) to the Axis and the two measures as the values. But the problem with this is that measure SUM( 'Payment Behaviour'[PaymentAmount] also uses the date that is defined in the 'Invoice Headers' table and not the date 'Payment Behaviour'[PaymentDate]. Does anyone know how I can solve this problem.

 

Thanks in Advance

  • Never mind, with some trial and error I found the solution. I had to use the USERELEATIONSHIP function.

     

    Measure =
    CALCULATE (
        SUM ( 'Payment Behaviour'[PaymentAmount] );
        USERELATIONSHIP ( 'Payment Behaviour'[PaymentDate]; Datum[Datum] )
    )

     

1 Reply

  • Dave93's avatar
    Dave93
    Frequent Visitor

    Never mind, with some trial and error I found the solution. I had to use the USERELEATIONSHIP function.

     

    Measure =
    CALCULATE (
        SUM ( 'Payment Behaviour'[PaymentAmount] );
        USERELATIONSHIP ( 'Payment Behaviour'[PaymentDate]; Datum[Datum] )
    )