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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
KausthubhJ
Regular Visitor

We created a weighted average and now when we get QTD of that measure we don't get the desired resul

So the values of weighted average based on the dax I used

"dd weighted = DIVIDE  (      SUMX(          FactDebtors, FactDebtors[amount lcy +] * FactDebtors[Days of Outstanding - Real]          ),SUM(FactDebtors[amount lcy +])  )" are: April = 127, May = 122 and June = 124.

 

The measure "dd weighted qtd = TOTALQTD([dd weighted],'Calendar'[Date])" provides me with output : April = 127, May = 124 and June = 124.

 

So the values which I expect from dd weighted qtd are : April = 127, May = 249 and June = 373.

 

Can someone please help on this ?

What we are getting :

I am not getting the qtd as it should be as it is showing me a average of  dd weightedI am not getting the qtd as it should be as it is showing me a average of dd weighted

what we wanted :

Expected OutputExpected Output

 

 

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Actually my collegue helped and he updated the code :

dd weighted qtd = VAR curQ = MAX('Calendar'[FiscalMonthNum])
RETURN
TOTALQTD(SUMX(
    FILTER(
        SUMMARIZE(
            ALLSELECTED( 'Calendar'),'Calendar'[FiscalMonthNum],

            "Total AVG", [dd weighted]
            ),
            'Calendar'[FiscalMonthNum] <= curQ
        ), [Total AVG]
    ),'Calendar'[Date])
 
We got the results like these :
KausthubhJ_1-1674284338915.png

what do you guys think can there be any improvements ?

Also sorry we can't share the pbix file as we have client's data.

 

Run your Query through DAX Sudio and see if the query plan and the performance is acceptable for your amount of data.

lbendlin
Super User
Super User

Keep the quarter filter and set/override the month filter to less than or equal to current month.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.