Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a problem I am trying to solve. Basically, I am trying to build a report to identify variances between sales order lines and trade agreements with customers. There are two tables, a sales line table and a trade agreement table.
Sales order line table:
| Sales Order Number | Customer Account Number | Sales Line Price | Item Number | Quantity Ordered | Delivery Date |
Trade agreement table:
| Item Number | Customer Account Number | Quantity From | Quantity To | From Date | To Date | Price |
Some important factors:
So there are a few different examples/scenarios I am trying to address with this report:
Sales order line table:
| Sales Order Number | Customer Account Number | Sales Line Price | Item Number | Quantity Ordered | Delivery Date |
| 150 | 2000 | 30 | 1 | 100 | 1/15/2024 |
Trade agreement table:
| Item Number | Customer Account Number | Quantity From | Quantity To | From Date | To Date | Price |
| 1 | All | 50 | 150 | 12/1/2023 | 1/31/2024 | 25 |
Sales order line table:
| Sales Order Number | Customer Account Number | Sales Line Price | Item Number | Quantity Ordered | Delivery Date |
| 500 | 1500 | 30 | 2 | 1,200 | 1/10/2024 |
Trade agreement table:
| Item Number | Customer Account Number | Quantity From | Quantity To | From Date | To Date | Price |
| 2 | All | 1000 | 2000 | 10/1/2023 | 12/31/2023 | 30 |
Sales order line table:
| Sales Order Number | Customer Account Number | Sales Line Price | Item Number | Quantity Ordered | Delivery Date |
| 1000 | 100 | 50 | 3 | 5 | 1/3/2024 |
Trade agreement table:
| Item Number | Customer Account Number | Quantity From | Quantity To | From Date | To Date | Price |
| 3 | All | 15 | 29 | 10/1/2023 | 1/31/2024 | 50 |
So basically, the variances are:
I want to first look for a trade agreement for the item number and the specific item number, so for item 1 and customer account number 2000, I would first look to see if there is an active trade agreement for that item and customer account number 2000, but if there wasn't one, but there was a valid agreement for the customer account number all, then there would be no variance.
Any ideas on how to go about accomplishing this in Power BI?
Solved! Go to Solution.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 39 | |
| 37 | |
| 29 | |
| 24 |
| User | Count |
|---|---|
| 120 | |
| 95 | |
| 70 | |
| 69 | |
| 65 |