Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm trying to write a measure that calculates the margin.
I wrote the code and am getting the following error:
A single value for column 'amount' in table 'Module Sales with Inventory' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.
I have attached the measure below. Any help would be greatly appreciated.
Solved! Go to Solution.
Hi,
Please try something like below.
Margin =
DIVIDE (
SUMX (
'Module Sales with Inventory',
'Module Sales with Inventory'[amount] - 'Module Sales with Inventory'[cost amount]
),
SUMX ( 'Module Sales with Inventory', 'Module Sales with Inventory'[amount] )
) * 100
Hi,
Please try something like below.
Margin =
DIVIDE (
SUMX (
'Module Sales with Inventory',
'Module Sales with Inventory'[amount] - 'Module Sales with Inventory'[cost amount]
),
SUMX ( 'Module Sales with Inventory', 'Module Sales with Inventory'[amount] )
) * 100
That seems to have worked!
Thank you so much!
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |