Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dave93
Frequent Visitor

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. 

Two dates.png

 

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

1 ACCEPTED SOLUTION
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] )
)

 

View solution in original post

1 REPLY 1
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] )
)

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.