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
cdawidow
Helper III
Helper III

How to calculate results filtered on the many side? (Many to One Relationship)

Hi guys, I have 2 tables one is a product table (PRD PC) and the other is my Sales Fact Table where I have my customer names.  Essentially, I want to calculate cumualtive sales of product lines filtered by a selected customer name.  I have cumulative totals and cumulative % as calculated columns in my product table (PRD PC) but as you can see below, I do not get the correc tinformation.  It gathers the total (ALL) amount of the specific product line and does not filter based on my selected customer.  What is the best way that can allow me to fix this issue?

 

 

RELATIONS.PNGWRONG.PNG

 

 

 

ant.PNG

 

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@cdawidow Sorry, having trouble following, can you post sample data as text and expected output?


Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@cdawidow , can you share the formula?

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

Hey, I am not using a formula, I am simply selecting the columns from the ONE side table and matching it by customer name which is found from the many side

@cdawidow , I was checking for cumulative

 

It needs to use all selected

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(Table),Table[product] <=max(Table[product])))

or


Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(Table),Table[product] <=max(Table[product]) && Table[customer] =max(Table[customer]) ))

or

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(product),product[product] <=max(product[product]))
,filter(allselected(customer),customer[customer] =max(customer[customer])))

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
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.