I am a heavy user of R who is trying to port some basic calculations to Power BI but unable to get DAX to perform vector/rowwise division.
For example, with this dataset:
Category Value
A 1
A 2
B 3
C 4
I have created a measure: Value Sum = SUM(Table[Value]) and I would like to create a third column: Value Share = Value / Value Sum to get:
Category Value Value Share
A 1 0.1
A 2 0.2
B 3 0.3
C 4 0.4
The equivalent in R would be table$Value.Share = table$value/Value.Sum.
I have tried: Value Share = [Value] / [Value Sum] but I ended up with 1s in all Value Share rows. Tried SUMX and CALCULATETABLE functions but I believe I am missing something fundamental. Can anyone help?