cancel
Showing results for 
Search instead for 
Did you mean: 
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
Super User II
Super User II

@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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors