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

Calculate ALL Help

Hi.  I have a some data has the following data: Contract, Date ,Employee, Hours, Task.  Here is a table w/ hours summarized at the contract level.

 

ContractHours
ABC1000
CDE2000
EFG3000


I want to be able to filter by date/contract but ignore task.  I figure the calculation is Contract Hours = Calculate(SUM[Hours]),ALL(Task))


Here is my expectation.

ContractTaskContract HoursHours
ABC11000250
ABC21000250
ABC31000250
ABC41000250
CDE12000500
CDE22000500
CDE32000500
CDE42000500
EFG13000600
EFG23000600
EFG33000600
EFG43000600
EFG53000600

 

However, the results are very different.  I figure this should be a pretty easy but I'm definitely missing something.  

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @dyee4613 , I tested your measure and it works well to display your expectation in the table visual. I also tested another measure using ALLEXCEPT function which also works as below. Can you check or confirm is there any other fields used in the visual or any filters applied which may affect the context for the measure?

 

Contract Hours = Calculate(SUM('Table (2)'[Hours]),ALL('Table (2)'[Task]))
Contract Hours 2 = Calculate(SUM('Table (2)'[Hours]),ALLEXCEPT('Table (2)','Table (2)'[Contract]))

 

Here is the sample data I used:

v-jingzhang_0-1600939884288.png

And the table visual result:

v-jingzhang_1-1600939884291.png

 

Best Regards,

Community Support Team _ Jing Zhang

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

PaulDBrown
Community Champion
Community Champion

@dyee4613 

Using  ALLEXCEPT(table, table[contract]) as the filter expression will solve this. However, as always, it depends on how your model is set up and which fields you are using (Dimension tables, date table...) in your target visual.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.