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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Lukasz_Lyszczak
Frequent Visitor

Aggregation in context

Dear Community,

 

I'm trying to solve the problem with agregation in context. Have looked throug lot of posts in forum, unfortunatel haven't found solution.

My data model includes 3 bases. Main AD with all categories (t_item). MPS and BOM are related (multiple to one) to AD (MPS_t_item --> AD_t_item and BOM_t_mitm --> AD_t_item). MPS contains als column with dates and qunatities (t_oqan) for all categories.

 

Lukasz_Lyszczak_0-1678354815614.png

 

I'm trying to sum all quantities divided by days or months for each subcategory (BOM_t_sitm).

I see that relation is working cause when I put into matrix category, subcategory and qty results are ok and changing according to chosen period of time.

 

Lukasz_Lyszczak_1-1678355064599.png

 

Unfortunately when I'm deleting main category from matrix, agregation is not working properly and for each subcategory I'm receiving total sum of qty for all categories.

 

Lukasz_Lyszczak_2-1678355100456.png

I was trying multiple mesures with difrent summing functions (found in this forum) unfortunately witho positive result.

 

Thanks for your help.

Regards, Łukasz

1 ACCEPTED SOLUTION
Lukasz_Lyszczak
Frequent Visitor

Update. Have found the solution:

 

Demand = CALCULATE(SUM(MPS[t_oqan]),FILTER(AD,AD[t_item] in DISTINCT(BOM[t_mitm])))

View solution in original post

1 REPLY 1
Lukasz_Lyszczak
Frequent Visitor

Update. Have found the solution:

 

Demand = CALCULATE(SUM(MPS[t_oqan]),FILTER(AD,AD[t_item] in DISTINCT(BOM[t_mitm])))

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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