The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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)
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |