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
alikemalaydin
Frequent Visitor

How can I show the same amount by the same Branches invoice and payment?

Hi,

 

I have two different datasets.

Invoices and payments.

 

Invoice data has Branch,Company_Code,Company_Name,Invoice_Amount

 

Payment data has Branch,Company_Code,Company_Name,Payment_Amount

 

These two data connected to each other Company_Code.

 

If I made a table and use Slicer to filter the data by Branch, Amount summarizes filtered the only which I used table branch. 

 

Example:
I have 5 records under different Branches. Also Payment.
How can I show the same amount by the same Branches invoice and payment?

 

Report Table:

CustomersInvoice amountPayment Amount
Customer Name11.1001.600

 

Data: Invoice

Company CodeBranchCustomersInvoice Amount
12345ACustomer A1.600
12345BCustomer A2.000
12345CCustomer A2.000
12345DCustomer A2.500
12345ECustomer A3.000

 

Data:Payment

Company CodeBranchCustomersPayment Amount
12345ACustomer A1.600
12345BCustomer A2.000
12345CCustomer A2.000
12345DCustomer A2.500
12345ECustomer A3.000

 

11.100 comes from 5 records. 1.600 comes from 1 record because Slicer selected Payment's table Branch. 

I want to filter also invoice amount by the Payment's Branches. 1.600 - 1.600

 

Customer Total Invoice Total Payment
Customer Name 18.384 1.600


Thanks to advise.

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@alikemalaydin 

By your description, (assuming you have more than one customer by branch), all you need to do is:

1) delete the company_code relationship between both fact tables

2) create a new dimension table for "Branch" for the unique "Branch" values and join this to each fact table with a one-to-many  relationship with the corresponding Branch fields in each fact table

3) create a dimension table with the unique values for "Customer", and join this table to both your fact tables in a one-to many  relationship with the corresponding customer field in each fact table.

4) the create simple sum measures for invoice amount and payment amount.

5) create a table visual with the Customer field from the newly created dimension table, and both your [invoice amount] and [payment amount] measures.
6) use the Branch field from the newly created Branch dimension table as your slicer.

 

Model.JPGResult.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

6 REPLIES 6
alikemalaydin
Frequent Visitor

Hi,

I've just realized.

If there is no payment or one of the invoices, it does not appear in the table as zero.

How can I fix it?

 

CustomerTotal InvoiceTotal Payment
Customer A50000
Customer B02000

@alikemalaydin 

You can solve this by simply adding "+ 0" to your measures. For example:

Sum of Payments = SUM(Table [payment amount]) + 0





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Thank you so much +0 works well.

PaulDBrown
Community Champion
Community Champion

@alikemalaydin 

By your description, (assuming you have more than one customer by branch), all you need to do is:

1) delete the company_code relationship between both fact tables

2) create a new dimension table for "Branch" for the unique "Branch" values and join this to each fact table with a one-to-many  relationship with the corresponding Branch fields in each fact table

3) create a dimension table with the unique values for "Customer", and join this table to both your fact tables in a one-to many  relationship with the corresponding customer field in each fact table.

4) the create simple sum measures for invoice amount and payment amount.

5) create a table visual with the Customer field from the newly created dimension table, and both your [invoice amount] and [payment amount] measures.
6) use the Branch field from the newly created Branch dimension table as your slicer.

 

Model.JPGResult.JPG

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Hi,

 

I think it works well now.

Thank you so much.

 

Can I use same way for dates?

Example date dimension table.

It has been a few months since I started using Power Bi.
It's fun but formulas and logic are not like excel. 🙂
my table relationship like below.
Maybe it is a little bit confuse or a long way. 🙂

 

alikemalaydin_0-1605012349999.png

 

 

 

@alikemalaydin 

Sure you can use the same idea for dates. It's actually a "best practice" to set up a date table with continuous dates covering the range of dates in your model as a dimension table.

let us know if you need help!





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.