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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello guys,
I am just starting out with DAX and I wanted to get some idea on how to do the following. I have a single Table that records sales transcations for "Products". Each transcation has a "Sales_quantity" and "Price". Additionally, the table has a "%Sales" Column that records the percentage of sales of the transcation for the product as a whole, which I've already calculated. What I need is the blue column "Target" that calculates the cumulative %Sales of each Group ranked by Price but i have no idea how to use DAX to calculate this column. Can you help me out here?
| Product | Sales_quantity | Price | %Sales | Target |
| A | 2000 | 3 | 66,66% | 100% |
| A | 1000 | 2 | 33,33% | 33,33% |
| B | 2000 | 20 | 20% | 50% |
| B | 3000 | 18 | 30% | 30% |
| B | 5000 | 21 | 50% | 100% |
Solved! Go to Solution.
Create a calculated column using the below
Target =
var currentPrice = 'Table'[Price]
var totalSales = CALCULATE( SUM('Table'[Sales_quantity]), ALLEXCEPT('Table','Table'[Product]) )
var filteredSales = CALCULATE( SUM('Table'[Sales_quantity]), ALLEXCEPT('Table','Table'[Product]),'Table'[Price] <= currentPrice )
return DIVIDE( filteredSales, totalSales )
Create a calculated column using the below
Target =
var currentPrice = 'Table'[Price]
var totalSales = CALCULATE( SUM('Table'[Sales_quantity]), ALLEXCEPT('Table','Table'[Product]) )
var filteredSales = CALCULATE( SUM('Table'[Sales_quantity]), ALLEXCEPT('Table','Table'[Product]),'Table'[Price] <= currentPrice )
return DIVIDE( filteredSales, totalSales )
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 7 | |
| 7 | |
| 6 |