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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Power BI DAX - Average Per Category Calculation

I have a requirment to average by 2 Categories i.e. By Date (Year/Quarter/Month) and by Market. How could I get in DAX average by tow categories?. 

 

Using Quick Measure I get this , how to add another category  - By Date (Year/Quarter/Month)?

AVERAGEX(
    KEEPFILTERS(VALUES('Office'[Market])),
    CALCULATE(SUM([Column1]))
)

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You could try ALLEXCEPT() function.

Measure = CALCULATE(AVERAGE('Table'[value]),ALLEXCEPT('Table','Table'[date],'Table'[categories])

 

Best Regards,

jay 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Not very clear

Try like


AVERAGEX(Summarize('Office','Office'[Market],'Office'[Market], "_1",CALCULATE(SUM([Column1]))), [_1])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Thanks for the reply, but in the DAX I need to summarize by 2 categories , 

1. By Date
2. By Market

I used below Dax. but in my visualtion I add this new measure along with the Date or  Office get Error

AVERAGEX(SUMMARIZECOLUMNS(Date[Calendar Month],Offices[Name],"Name1", SUM(Column1[]), [Name2])

 

Hi @Anonymous ,

 

You could try ALLEXCEPT() function.

Measure = CALCULATE(AVERAGE('Table'[value]),ALLEXCEPT('Table','Table'[date],'Table'[categories])

 

Best Regards,

jay 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.