Forum Discussion

floralsnow's avatar
floralsnow
Frequent Visitor
4 years ago
Solved

DAX: subtraction work but not division

I'm having difficulty understanding how you calculate when comparing two different tables.

I created a simple mockup which exemplifies what I'm dealing with.

 

I have two tables which are connected to a calendar table.

I have a measure where I'm trying to divide two values where each of them exist in their own table.

 

I created these to make it easier to refer to the different values.

Cost = SUM('R-Cost'[Amount Eur])
Revenue = SUM('R-Revenue'[External Revenues EUR])
 
I then try to calculate the margin with this measure
Margin = DIVIDE('Calculations'[Cost],'Calculations'[Revenue])
but this results in zeroes! I was thinking that maybe my relationships are wrong, but, I am able to subtract.

This measure works fine for example:
Diff =
VAR _Cost = 'Calculations'[Cost]
VAR _Revenue = 'Calculations'[Revenue]
VAR _Diff = (_Revenue - _Cost)
RETURN _Diff
 
So how come subtraction works but not division?
 

 

 I have googled like crazy but I just don't understand what I'm missing.

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi floralsnow 
    It may be due to the Y-Axis Scale. Since you have scale of Y-Axis set at the hundred million level, the result of the division which is a fractional value between 0 and 1(for example, at the starting point it is 54M/221M which is about 0.24), is too small to be plotted on this line chart. You can check the actual values by setting the display units of the data label to none.