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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ctrip77
Frequent Visitor

Dax Measure to get the average of a column at total level

Hi everybody, Im trying to do a dax measure that has to calculate the total average of the values of the column cells, this measure has to work with any attributes and/or level in the pivot table (excel). The thing is I have correct values only at store level, but no for the other attributes in my model.

To better describe my problem, I attached a sample power BI file.

thanks a lot for your help!

Power BI Sample File 

2 REPLIES 2
Sergiy
Resolver II
Resolver II

@ctrip77 , hello

 

try this measure:

average Sales_per_store_v1 = 
AVERAGEX(
    dim_machines,
    DIVIDE(
        [Total Sales],
        [Number_of_Stores]
    )
)

 

Is it of any help?

Thans for your reply @Sergiy !

Your metric works perfect, but only when in the table you put the Machine_Name attribute.

If I change Machine_name to Cat_1 then my average is wrong again.

That's just the problem that I can not solve!, I just want a metric that works for any attribute in the model, it should always show the average of the values displayed in the column (in the grand total row)

have any workaround for this?

thanks!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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