Forum Discussion
gbarr12345
2 years agoPost Prodigy
Measure query
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...
- 2 years ago
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
Jihwan_Kim
2 years agoSuper User
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
- gbarr123452 years agoPost Prodigy
That seems to have worked!
Thank you so much!