Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
laythingy59
New Member

Weighted Average Help

Guys I'm really struggling with DAX and weighted Averages. 
I sort of know what I'm doing in SQL, but I can't translate this into DAX. The new quick measure doesn't seem to work either.

 

I'm trying to get the Average rate(APR) weighted by the value proposed for each month of the year. This is how I've done it for one dataset in SQL. 

 

laythingy59_0-1660564742486.png

My other dataset which I'm comparing against is in CSV format and I'm importing it straight into PowerBI. 

I'm a complete Novice with DAX and powerbi so please go easy on me 😄

 

Many thanks

Adam

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below.

I suggest having a calendar table like below.

 

Picture1.png

 

Weight Avg measure: =
DIVIDE (
    SUMX ( Data, Data[Value proposed] * Data[Rate] ),
    SUMX ( Data, Data[Value proposed] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below.

I suggest having a calendar table like below.

 

Picture1.png

 

Weight Avg measure: =
DIVIDE (
    SUMX ( Data, Data[Value proposed] * Data[Rate] ),
    SUMX ( Data, Data[Value proposed] )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Thank you, that's exactly what I was after. I now have to figure out how to put the two sets of results onto one line graph.

laythingy59
New Member

Here's some sample data. 

Value Proposed,Rate,GO LIVE
1395,19.9,01/01/2022
1795,14.9,01/01/2022
2570,19.9,01/01/2022
1797,19.9,01/01/2022
1418,19.9,01/01/2022
2465,19.9,01/01/2022
1749,19.9,01/01/2022
2650,19.9,01/01/2022
1975,19.9,01/01/2022
2799,14.9,01/01/2022
2530.81,14.9,01/01/2022
3209,19.9,01/01/2022
1745,19.9,01/01/2022
2089,14.9,01/01/2022
1897.2,19.9,01/01/2022
1860,14.9,01/01/2022
2025,19.9,01/01/2022
2494,14.9,01/01/2022
1599,14.9,01/01/2022
6602,14.9,01/01/2022
1775,19.9,01/02/2022
1805,19.9,01/02/2022
2300,14.9,01/02/2022
2395,14.9,01/02/2022
2850,19.9,01/02/2022
4440,19.9,01/02/2022
1795,19.9,01/02/2022
2274,14.9,01/02/2022
2070,14.9,01/02/2022
2218,19.9,01/02/2022
1949,19.9,01/02/2022
4295,19.9,01/02/2022
20000,21.5,01/02/2022
8980,19.9,01/02/2022
10560,19.9,01/02/2022
15000,19.9,01/02/2022
1683,19.9,01/02/2022
9000,19.9,01/02/2022
4501,19.9,01/02/2022
4999,19.9,01/02/2022
9900,21.5,01/02/2022
2300,19.9,01/02/2022
7990,19.9,01/02/2022
3152,21.5,01/02/2022
2700,19.9,01/02/2022
3988.04,19.9,01/02/2022
2109,19.9,01/02/2022
8000,19.9,01/02/2022
2721,19.9,01/02/2022
5800,19.9,01/02/2022
7017,19.9,01/02/2022
1029,19.9,01/02/2022
4251,19.9,01/02/2022
7926,19.9,01/03/2022
5268,19.9,01/03/2022
3000,19.9,01/03/2022
3881,19.9,01/03/2022
1800,19.9,01/03/2022
2000,19.9,01/03/2022
1350,21.5,01/03/2022
2400,19.9,01/03/2022
9924,21.5,01/03/2022
6163,19.9,01/03/2022
1708,19.9,01/03/2022
2272.73,19.9,01/03/2022
2004,19.9,01/03/2022
1950,19.9,01/03/2022
3000,19.9,01/03/2022
4130,19.9,01/03/2022
6884,19.9,01/03/2022
5050,21.5,01/03/2022
4875,19.9,01/03/2022
7100,21.5,01/03/2022
5670,21.5,01/03/2022
2456,19.9,01/03/2022
6100,19.9,01/03/2022
2561,19.9,01/03/2022
10865,19.9,01/03/2022
1099,19.9,01/03/2022
6410,19.9,01/03/2022
4222,19.9,01/03/2022
8941,21.5,01/03/2022
6959,21.5,01/03/2022
2715,19.9,01/03/2022
1670,19.9,01/03/2022
1945,19.9,01/03/2022
6375,19.9,01/03/2022
1849,19.9,01/04/2022
1770,19.9,01/04/2022
1938,14.9,01/04/2022
1645,19.9,01/04/2022
2320,19.9,01/04/2022
1980,19.9,01/04/2022
2015,19.9,01/04/2022
1680,14.9,01/04/2022
1703,19.9,01/04/2022

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors