Forum Discussion
Multiple value division using dax
- 4 years ago
Hi Anonymous ,
In my understanding, you want to calculate the total price divided by the unit price to get the quantity.
Measure is an aggregation operation, which requires context in calculation. Unlike calculated column, which refers to the current row, it can be directly referenced.
I create a sample.
Here's my solution, create a measure.
Measure = VAR _T = ADDCOLUMNS ( 'Table', "Quantity", DIVIDE ( 'Table'[totalprice], 'Table'[unitprice] ) ) RETURN SUMX ( _T, [Quantity] )You can put customer column and the measure in a table visual to get the seperate quantity of each customer or put the measure in a card visual to get the total quantity.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please considerAccept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
In my understanding, you want to calculate the total price divided by the unit price to get the quantity.
Measure is an aggregation operation, which requires context in calculation. Unlike calculated column, which refers to the current row, it can be directly referenced.
I create a sample.
Here's my solution, create a measure.
Measure =
VAR _T =
ADDCOLUMNS (
'Table',
"Quantity", DIVIDE ( 'Table'[totalprice], 'Table'[unitprice] )
)
RETURN
SUMX ( _T, [Quantity] )
You can put customer column and the measure in a table visual to get the seperate quantity of each customer or put the measure in a card visual to get the total quantity.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.