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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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)