Forum Discussion
DAX help (pathetic)
Hi ModelFear
Create a measure:
average margins =
var PriceEach = SELECTEDVALUE('SaleTable'[Price each])
RETURN
IF(
PriceEach <> 0,
(PriceEach - 'ProductionTable'[Measure]) / PriceEach,
BLANK()
)
I recommend that you choose to create the following visual:
Hope you found this useful!
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Dear Nono Here are the source files and the latest test file you sent for convenience: https://we.tl/t-exltVujYVw
Thank you so much for replying. Is it possible to have the average margins measure as a column in my source data that I can view under Table view sales table? A measure is hard to grasp for new bi users, who like to see what they have calculated. Having a column will allow me to make visuals easily. I understand there are concerns such as performance issues etc. Bosses would also know to click the table view to examine data or even copy table. A table visual in bi is not as easy to see or do things.
average margins =
var PriceEach = SELECTEDVALUE('SaleTable'[Price each])
RETURN
IF(
PriceEach <> 0,
(PriceEach - 'ProductionTable'[Measure]) / PriceEach,
BLANK()
)
Thank you so much again.
L