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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

weighted average for a month

Hi guys, I have a problem with my measure, 

 

I would like to do a progressive calculation. That is to say I have three columns, one with the number of session, one with the average time per session and another with the cumulative number of session each month.

 

Starting from a date, I would like to calculate a weighted average on a month period. For each day from the date I started to the last month, i want to divide the number of sessions of each day by the cumulative number of session each month equal to the DAY I STARTED. The total multiplied by the average time per session. 

DIVIDE(
	CALCULATE (
	    SUM ( 'Google analytics'[Number of sessions] )
	        * SUM ( 'Google analytics'[Average time per session] ),
	    DATESINPERIOD (
	        'Google analytics'[Date].[Date],
	        FIRSTDATE ( 'Google analytics'[Date] ),
	        -1,
	        MONTH
	    )
	),
	 SUM ( 'Google analytics'[Cumulative number of session each month] )
)

To give you an exemple I am giving you this excel:

 

Sniv_0-1655283579498.png

I want to calculate the session time weighed average for the DAY 6, so i have to sum all the session time weighed average of all other days. To calcul them, i am using the last cumulative number of sessions. 

Sniv_1-1655283746233.png

 

I hope you can help me, tell me if i'm not clear enough. 

3 REPLIES 3
Anonymous
Not applicable

@SpartaBI Perhaps you can help me for this thing.

Hi, @Anonymous 

It is necessary to first judge whether the results returned by the numerator and denominator are correct.

Can you share a sample file for further investigation?

 

Best Regards,
Community Support Team _ Eason

Anonymous
Not applicable

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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