Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
We have Unit price with us for various items
Need to calculate actual and weightage by dax
Actual - divide (unit price/total unit price)
Weightage is flipped- lowest of actual is assigned to highest unit price. Second lowest actual to second highest unit price and so on..
Weightage is the Final output needed
Solved! Go to Solution.
Source Data
Actual Calculation
Rank in Descending Order
Rank in Ascending order
Weightage
Source Data
Actual Calculation
Rank in Descending Order
Rank in Ascending order
Weightage
Calculate Actual as the ratio of Unit Price to the total Unit Price
Actual =
DIVIDE(
Items[Unit Price],
CALCULATE(SUM(Items[Unit Price]), ALL(Items))
)
Rank Unit Prices in descending order
UnitPriceRank =
RANKX(
ALL(Items),
Items[Unit Price],
,
DESC,
DENSE
)
Rank Actual values in ascending order
ActualRank =
RANKX(
ALL(Items),
Items[Actual],
,
ASC,
DENSE
)
Assign Weightage by matching the ranks of UnitPriceRank and ActualRank
Weightage =
CALCULATE(
MAXX(
FILTER(
ALL(Items),
Items[ActualRank] = Items[UnitPriceRank]
),
Items[Actual]
)
) Let me know if it helped you a bit and if you need further assistance or have any questions!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 32 | |
| 19 | |
| 12 | |
| 10 |