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! It's time to submit your entry. Live now!
How would I write the following formulas in DAX:
If you see in the last two columns, I have written the formulas and the Last column is how the Excel formula looks like, which is, Cost(a)/Sum of Cost for week 1, and so on and so forth for each product. Essentially we want to be able to find Cost Percentage per week per product. I'm not able to grasp the exact formula for this in DAX.
Thanks for the help!:)
hi @Anonymous_
try to add a column like this:
Cost%2 =
DIVIDE(
[Cost],
SUMX(
FILTER(
TableName,
TableName[Week]=EARLIER(TableName[Week])
),
TableName[Cost]
)
)if you feel more comfortable with CALCULATE, it looks like this:
Cost%3 =
DIVIDE(
[Cost],
CALCULATE(
SUM(TableName[Cost]),
ALLEXCEPT(TableName, TableName[Week])
)
)The Power BI Data Visualization World Championships is back! It's time to submit your entry.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 12 | |
| 10 | |
| 9 | |
| 8 | |
| 7 |