We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Can we divide two columns with multiple values in power bi ?? if yes, then please tell. I am trying to divide two columns with multiple values. the columns are total price and unit price ,...
How can I find Quantity??
Solved! Go to Solution.
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.
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.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 38 | |
| 33 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 38 | |
| 34 | |
| 22 |