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
DebbieE
Community Champion
Community Champion

Average Measure across numerous Months in a visual

GetAnAverage.JPG

this visual could contain a year or two years etc

I want some DAX to find the average Fact per month. So if 3 months are displayed, the average over the 3 months

If more months are displayed, the average over all these months.

 

Any help would be appreciated. does this make sense?

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

=Calculate([your measure],allselected(Calendar))

There should be a Calendar Table which should have a relationship with the Date column of the Data Table.  To your visual, drag Year and Month from the Calendar Table.

Hope this helps.


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

View solution in original post

Icey
Community Support
Community Support

Hi @DebbieE ,

 

Try this:

Avg = AVERAGEX ( ALLSELECTED ( Calendar ), [your measure] )

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Does this measure work?

=Calculate([your measure],allselected(Calendar))

There should be a Calendar Table which should have a relationship with the Date column of the Data Table.  To your visual, drag Year and Month from the Calendar Table.

Hope this helps.


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

I think it may work but Im getting a different number to what I should be doing. i have added a flag to the card to specify a certain number of months

I think its more my calculations than Power BI though


thank you

Whom are you replying to?  Hasn't my solution worked?  If not, then share the link from where i can download your PBI file.


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

Should it not contains something regarding average?

Icey
Community Support
Community Support

Hi @DebbieE ,

 

Try this:

Avg = AVERAGEX ( ALLSELECTED ( Calendar ), [your measure] )

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DebbieE
Community Champion
Community Champion

This hasnt worked. i have 6 months and years in my selection

 

The numbers are 829 1045 55 1174 57 1058

 

This came out as 31.95 as the average, shouldnt it be 703 ?

 

Im not quite sure what the 31.95 is

 

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.