We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hey folks,
I'm fairly new to Power BI so I appreciate all the help I can get 🙂
I have two tables, one with a sales ledger (Sales) and the other containing product information (Products). Each row on Sales details the Date, Item Number, Sales Amount, Sales Quantity and Cost Amount, and the rows in Products contain Item Number and Unit Cost (among other things).
Due to issues with the ERP I'm working with, Cost Amounts for some transactions on the Sales table are outrageously wrong and can't be corrected in the source data, so I need to calculate a corrected cost amount for transactions which meet a certain criteria (let's assume Sales Amount - Cost Amount < 0). For transactions meeting the criteria, I need to fetch the Unit Cost from the Products table and multiply that by Sales Quantity. Transactions which don't meet the criteria should be left as they are.
What would be the best way to go about this? My initial idea was to create a custom column (let's call it Corrected Cost) on the Sales table which evaluates the criteria and either calculates a new cost or inputs the existing Cost Amount. I'm just not sure how to make it happen 😄
Thanks in advance!
Solved! Go to Solution.
The exact details are going to depend on your data. But, let's say that Sales and Product tables are related on ProductID. You could do something like this:
Column = IF(([Sale Amount]-[Cost Amount])>0,[Sale Amount],RELATED('Products'[Price]))Something along those lines.
The exact details are going to depend on your data. But, let's say that Sales and Product tables are related on ProductID. You could do something like this:
Column = IF(([Sale Amount]-[Cost Amount])>0,[Sale Amount],RELATED('Products'[Price]))Something along those lines.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 37 | |
| 32 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 39 | |
| 34 | |
| 25 |