Forum Discussion
New Measure Issue - 'single value for column' error
Hi All,
I'm new to PBI. I'll start at the beggining! I'm trying to create a Sales Leaderboard with data coming from our CRM. I have the following relationships:
The reason I'm putting together the relationships this way is for a couple of reasons:
- Order Line Item and Order Split have no direct relationship. So one Order can have many line items, and many splits.
- The sales personnel I want to track are not always the owner of the order (hence why there is a relationship from Order Split to User).
Here is what I want to be able to do:
- At the Order Line Item level, I only want to pay sales people for the first 12 months of a deal. I have the start and end date of each Order Line Item, and I created a column called 'Pro Rated Margin' that looks at the Order Line Item and determines the amount for the first 12 months. This works.
- At the Order level, I have created a column called Pro Rated Margin Total that sums the Order Line Item's Pro Rated Margin for the Order ID. This works.
- At the Order Split level, I have a measure (Split Margin Total) that sums the Order's Pro Rated Margin Total for that Order, and I want to multiply it through by the Split Percentage/100. This does not work!
- It works when I get the sum of Pro Rated Margin Total for that Order ID - but I cannot seem to get it to work when I multiply thourgh by Split Percentage/100. This causes the 'A single value for column...' error.
- This is the function I am using:
- Pro Rated Margin - Order Total = SUMX('Order (2)',
CALCULATE(VALUES('Order (2)'[Pro Rated Margin Total]),FILTER('Order Split','Order Split'[Order__c] = 'Order (2)'[Id])
)
)
- Pro Rated Margin - Order Total = SUMX('Order (2)',
Here is a practical example:
- Order A has two Order Line Items:
- Software 1, which is a 24 month license for 24,000 USD.
- Software 2, which is a 12 month license for 10,000 USD.
- Order A has two Order Splits:
- Person 1 has a 50% split.
- Person 2 has a 50% split.
- Order B has one Order Line Item:
- Software 1, which is a 12 month license for 5,000 USD.
- Order B has one Order Split
- Person 1 has a 100% split.
For Order A, the Pro Rated Margin Total equals the sum of the Pro Rated Margin of each Order Line Item:
- This is calculated as (12/24 * 24,000) + (12/12 * 10,000) = 22,000.
For Order A, the Order Split's Split Margin Total for Person 1 is 11,000, and for Person 2 it is 11,000.
For Order B, the Pro Rated Margin Total is: (12/12 * 5,000) = 5,000.
For Order B, the Order Split's Split Margin Total for Person 1 is 5,000.
The Sales Leaderboard would then be calculated as:
- Person 1 - 17,000
- Person 2 - 11,000
I'm happy to upload some data, I just need to make it sample data. Should I just create a new set of basic tables to handle this?
I appreciate all of your help.
Thanks!