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

How to remove category in column with DAX-allexcept not work

Hi,

 

I want to calculate group average training duration that count total per group not per position. 

Capture.JPG

I try use ALLEXCEPT Dax but not work 

Group Average Duration/Staff = CALCULATE([Average Duration/Staff],ALLEXCEPT('Job Grade','Job Grade'[Job Grade]))

Jobgrade is my table name that have list of position , where i calculate average duration/staff use measures

Please help
1 ACCEPTED SOLUTION

@laurent_rio , if you want other filters to work

 

Group Average Duration/Staff = CALCULATE([Duration],filter(allselected(Course_Completion_Listing),Course_Completion_Listing[BU] =max(Course_Completion_Listing[BU]) ))

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

View solution in original post

5 REPLIES 5
laurent_rio
Helper I
Helper I

Yes it works !!! Super Thanks

laurent_rio
Helper I
Helper I

Hi it seems my DAX not work if i have filter. My filter is Business unit , 
using the formula 

Group Average Duration/Staff = CALCULATE([Duration],ALLEXCEPT(Course_Completion_Listing,Course_Completion_Listing[BU]))

will lock all the business unit to show eventhough filter applied 

Any idea ? 

@laurent_rio , if you want other filters to work

 

Group Average Duration/Staff = CALCULATE([Duration],filter(allselected(Course_Completion_Listing),Course_Completion_Listing[BU] =max(Course_Completion_Listing[BU]) ))

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

Hi @amitchandak 

Now the questions if the filter have all selection, it seems this DAX
Group Average Duration/Staff = CALCULATE([Duration],filter(allselected(Course_Completion_Listing),Course_Completion_Listing[BU] =max(Course_Completion_Listing[BU]) ))

Not give expected result

Here for example if i choose 1 BU, the result is OK 
1.JPG
But if i choose all BU or multiple BU Selection, i expect the group will show same total average hour/staff 
2.JPG
Can you help to modify the DAX so it work for all or multiple BU Selection ?

amitchandak
Super User
Super User

@laurent_rio , Allexpect will allow that filter to pass, means job Grade filter iwll pass

 

Try like

Group Average Duration/Staff = CALCULATE([Average Duration/Staff],ALL('Job Grade'[Job Grade]))

 

or

 

Group Average Duration/Staff = CALCULATE([Average Duration/Staff],ALLselected ('Job Grade'[Job Grade]))

 

 

Group Average Duration/Staff = CALCULATE([Average Duration/Staff],removefilters('Job Grade'[Job Grade]))

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

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.