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

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

Reply
tonijj
Helper IV
Helper IV

Power Query - Group by combined with FILTER

Hi all,

 

Been searching for a solution for my issue for some time, but its time to ask for some expertise 🙂

 

WHAT I want to achieve - I want to take a dataset and sort out by whats "in scope" and then group and summarize only the values per order number. 

 

Current Data set

Order Number

CN Code - Its an EU code, or a material code if you like

Item Value - per line item

In scope - predetermined from an Excel

 

Screenshot 2024-01-30 at 08.48.25.png

 

So, I want to basically want to summarize ONLY the items "In Scope", PER order number.

 

Wanted output ought to be:

Screenshot 2024-01-30 at 09.28.34.png

 

Problem: 

When I Group By in Power Query on "Order Number" - the previous step "Filter by IN SCOPE" is ommited and I cant seem to get around it. 

Any help is appreciated. 

5 REPLIES 5
Ahmedx
Super User
Super User

pls try this

Screenshot_6.png

Hi @Ahmedx 

Any chance you can share the steps or the pbix for me to look at? Sincerely 🙂 

I posted the file pbix in the first post
and the video is in the second post

to know how to do this watch my video

343.mp4

amitchandak
Super User
Super User

@tonijj , You can use a measure in visual, no need to group data in the Power query

 

calculate(Sum(Table[Item value]), filter(Table, Table[In Scope] = "X"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
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