
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sum the difference between the two measures
Hi,
When i add this measure sum ([Sales value BGN] - [Cost value BGN]) i receive the message "Error in expression"
Both sales and cost values BGN are measures - sum (sales) and sum(cost)
I just started in the reporting area and i have no clue why the expression is not correct
Do you have ideas?
Thank you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Are [Sales value BGN] and [Cost value BGN] in purple and identified as main measures?


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Double aggregation is not possible
Sum(sum( sales))
You can just use your actual expressions
=Sum(Sales)-Sum(Cost)
If you need to further aggregate the result of this, then it needs to be wrapped in Aggr() as below
=Sum ( Aggr (
Sum(Sales)-Sum(Cost)
, Dimension1, Dimension2) )
Replace Dimension1 and Dimension2 with the fields used in your chart /table or add more separated by commas as needed based on what granularity you need to aggregate it result on
If a post helps to resolve your issue, please accept it as a Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
try separating them into two columns:
sum ([Sales value BGN])
and sum([Cost value BGN])
and these are both numeric?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you!! i separated them and it worked 🙂
