Forum Discussion
Weighed Average DAX Expression
- 9 years ago
Hi ROBERTOCMRNO,
Could you post your all table structures with some sample data in this case? Without knowing that we can only guess and offer possible suggestions.:smileyhappy:
Normally, the DAX expression for Weighted Average should be similar like below.
[Average Med Age Weighted by Pop]= SUMX(Zips, Zips[TTL Pop] * Zips[Med Age]) / [Total Population]
And
WAC = SUMX ( 'Analytics_SourceDat', [Net_Active_Balance] * [INTEREST_RATE] ) / SUMX ( 'Analytics_SourceDat', [Net_Active_Balance] )In addition, here is a similar thread, and here is a good article about Weighted Averages(DAX) for your reference.
Regards
Thank you for reply,
I tried this, but does not work...
The result of column MetaDiariaPonderada must be same the column Total.
The value of column MetaDiariaPonderada must be increase by the Column Dia.
Hi ROBERTOCMRNO,
Could you post your all table structures with some sample data in this case? Without knowing that we can only guess and offer possible suggestions.:smileyhappy:
Normally, the DAX expression for Weighted Average should be similar like below.
[Average Med Age Weighted by Pop]= SUMX(Zips, Zips[TTL Pop] * Zips[Med Age]) / [Total Population]
And
WAC = SUMX ( 'Analytics_SourceDat', [Net_Active_Balance] * [INTEREST_RATE] )
/ SUMX ( 'Analytics_SourceDat', [Net_Active_Balance] )In addition, here is a similar thread, and here is a good article about Weighted Averages(DAX) for your reference.
Regards
- JustSayJoe3 years agoAdvocate IV
Let me rephrase the original request into something a little different, and see how you would adjust your DAX formula.
I have a table named 'Advertising'
I have a Date column and a Cost column
I'm paying a flat fee of $4,000 for a single month. I want to create a calculated column, Fees, that displays the weighted amount of of that $4,000 for each Date's total Cost.
For example:
(I didn't fill in every cell, but you get the idea. I'm looking for a DAX formula to populate the Fees column.)Date Cost Fees 4/1/2020 100.00 13.33 4/2/2020 50.00 6.67 4/3/2020 845.00 112.67 4/4/2020 321.00 42.80 4/5/2020 25.00 3.33 4/6/2020 4/7/2020 4/8/2020 4/9/2020 4/10/2020 4/11/2020 4/12/2020 4/13/2020 4/14/2020 4/15/2020 4/16/2020 4/17/2020 4/18/2020 4/19/2020 4/20/2020 4/21/2020 4/22/2020 4/23/2020 4/24/2020 4/25/2020 4/26/2020 4/27/2020 4/28/2020 4/29/2020 4/30/2020 Totals 30,000.00 4000.00 - Ashish_Mathur3 years agoSuper User
Hi,
Fill up with Cost column with numbers. Also, is there a seperate table of the flat fee with a Date column? Share that table (with 2 columns) as well.