Forum Discussion
Division error - fields does not appear
- Anonymous4 years ago
Anonymous
You need to add an function to refer to a value when creating a measure. In your case, using sum, max, min or any other function does not change the result. And to get the current year margin%, you can create a measure with filter to today()'s year:Current Year Margin% = Calculate( [Margin%], Filter(Table, [Date].[Year]= Year(Today()))
Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
This doesn't look like an error.
The quick-measure GUI is summing your values as you're using columns/fields as the inputs.
Columns/fields contain many values, but you can only divide a single value by another single value, so Power BI is aggregating (summing here, but could be average, min, max etc) all the values in the column to one value.
What you are asking PBI to do:
1, 5, 6, 8 / 3, 7, 6
What PBI is aggregating this to:
20 / 16
Similarly, in your first picture where you are typing the DIVIDE function manually, you will need to aggregate your column values in order for DAX to accept them as numerator/denominator values, something like this:
DIVIDE(
SUM(yourTable[Integratedgross profit]),
SUM(yourTable[External sales]),
0
)
Hope this makes sense.
Pete