Forum Discussion
Trying to get Dynamic Weighted Average
- Anonymous9 years ago
rvokkarane wrote:
Lydia,
The final goal is to get to % value. For example: between given two dates, SUM of LOAN of 150-159/SUM of all Loans. Again between two dates, not all time.
Hi rvokkarane,
Create the following measures, check if percent returns your expected result.
Sum of loan of score group between dates = CALCULATE(SUM(Query1[LOAN]),ALLSELECTED(Query1[Date]))
Sum of all loan between dates = CALCULATE(SUM(Query1[LOAN]),ALLSELECTED(Query1[Score Group]))
percent = [Sum of loan of score group between dates]/[Sum of all loan between dates]
You can see the example. - Anonymous9 years ago
Hi rvokkarane,
Please ensure that you create a measure named ww as shown in the following screenshot? If the issue still persists, please share me your PBIX file so that I can test.
Thanks,
Lydia Zhang
Hi rvokkarane,
Based on your description, the ww column doesn’t filter by DATESOLD slicer and the Query1 contains DATESOLD column , right? If that is the case, change your formula as follows.
Column = CALCULATE(SUM(Query1[LOAN]),FILTER(ALLSELECTED(Query1[DATESOLD]),Query1[Score Group]=EARLIER(Query1[Score Group])))
However, if the above formula doesn’t help, please share raw data of your table and post expected result here.
Thanks,
Lydia Zhang
Lydia,
I have also attached a expected result here. So the Sold & Originations column are dynamic with datesold and are grouped by Score group mentioned earlier.
I think another challenge would be to get the denominator to work, because I want it to use the Total for the data being displayed or dynamic to datesold, in this case the 7million which for Sept-16. I appreciate your help so much. Thank you.