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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.