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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
stefani_vileva
Resolver II
Resolver II

Sum of group by with filter

Hello everyone, 

 

I have problem with calculating the sum of all the mistakes group by order numbers based on every user. I have the following table:

User IDMistakesOrder nrBoxesDate
1234555126.07.2023
1234555426.07.2023
2345657325.07.2023

 

I would like to get the following table

DateUser IDMistakes
26.07.20231234
25.07.20232345

 

I have tried with the following formula but every time I get the values summed by order number. 

 

Mistakes count = 
CALCULATE(
     SUM('Scanned items'[Mistakes]),
     ALLEXCEPT('Scanned items', 'Scanned items'[Order nr]),
     CROSSJOIN('All users', 'Scanned items')
)

 

I am cross joining the tables because in the tables All users I have the names of the users in the system.

Thank you in advance for your help.

 

Kind regards,

Stefani

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @stefani_vileva ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a table.

New table = 
SUMMARIZE(
    'Scanned items',
    'Scanned items'[Date],
    'Scanned items'[User ID],
    'Scanned items'[Mistakes]
)

(3) Then the result is as follows.

vtangjiemsft_0-1690508837934.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @stefani_vileva ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a table.

New table = 
SUMMARIZE(
    'Scanned items',
    'Scanned items'[Date],
    'Scanned items'[User ID],
    'Scanned items'[Mistakes]
)

(3) Then the result is as follows.

vtangjiemsft_0-1690508837934.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hello @Anonymous ,

 

Thank you for your help. I solved the problem using a similar approach by grouping them in the power query, but in the end we have the same result.

 

Thanks a lot. 

Kind regards,

Stefani

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors