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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.