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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.