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
BLM
Helper I
Helper I

AVERAGE

hii

i'm trying calculate the value average of a group of products. I attached a image with the column target:MEDIA.jpg

 

i don't know calculate this measure, anyone can help me, please.

 

thank

1 ACCEPTED SOLUTION

Hi @BLM

 

I have uploaded a simple PBIX file using your sample data set and it shows the measure working.  The only way it can come up with another figure is if there is other data in the model that we can't see.  Have a look at this and see what you think.

 

https://1drv.ms/u/s!AtDlC2rep7a-oi35BPacpxPxFVty

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=CALCULATE(AVERAGE([Unidades]),ALL(Data[PeriodoCalculo]))

 

Hope this helps.


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

HI @BLM

 

A calculation to find the average of the [Unidades] column per [CodArticulo] is as follows:  but this looks like what you have.  What is the number you are expecting?

 

media = 
    CALCULATE(
        AVERAGE('Table1'[Unidades]),
        FILTER(
            ALLSELECTED(Table1),
            'Table1'[CodArticulo] = MAX('Table1'[CodArticulo]
            )
        )
		)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

sol1.jpg

 Yes, i'm expecting the average per CodArticulo, but your formula don't work. I attached image with the result.

The values that I expected are in the first image that I attached.

 

thank

Hi,

 

Share the link from where i can download your file.


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

Hi @BLM

 

I have uploaded a simple PBIX file using your sample data set and it shows the measure working.  The only way it can come up with another figure is if there is other data in the model that we can't see.  Have a look at this and see what you think.

 

https://1drv.ms/u/s!AtDlC2rep7a-oi35BPacpxPxFVty

 

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

thank, it's work like I need.

 

thank you

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.