Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Guys, need urgent help.
I want to show Weighted Average Margin agsinst Date and Product. I have prepared a DAX but it is gowing overall Margin if you see in the last row of the total. Following is my DAX. Kindly help me what should I do.
Weighted Avg Margin = (
Var dailytotalsales =
Calculate(
Sum(April_2025[Total Slaes]),
Allselected(),
Values( April_2025[InvoiceDate].[Date])
)
Var dailytotalcost =
Calculate(
Sum(April_2025[Total Cost]),
Allselected(),
Values( April_2025[InvoiceDate].[Date])
)
RETURN
Divide(
(dailytotalsales + dailytotalcost),
dailytotalsales
)
)
Solved! Go to Solution.
Hi @MAlimalik ,
I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
Thank you.
Hi @MAlimalik ,
I just wanted to kindly follow up to see if you had a chance to review the previous response provided by us. I hope it was helpful. If yes, please Accept the answer so that it will be helpful to others to find it quickly.
Thank you.
Hi @MAlimalik ,
I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
Thank you.
Hi @MAlimalik ,
Thank you @techies for the prompt response!
Please use the below DAX:-
Hi @MAlimalik please try this
Weighted Avg Margin =
VAR TotalSales = SUM(April_2025[Total Slaes])
VAR TotalCost = SUM(April_2025[Total Cost])
RETURN
DIVIDE((TotalSales - TotalCost), TotalSales)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 12 | |
| 11 | |
| 9 | |
| 8 |