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
Alf1507
Frequent Visitor

How to calculate a cumulative filter by columns of the same table and columns of another table

I have a DAX formula, to calculate cumulative productions based in same table date column, and need to filter by another table columns values. Some body could help me?

Thanks a lot.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Alf1507 ,

There is a  way to calculate cumulative productions is to use the CALCULATE function with the FILTER function and the ALL function. For example, you can create a measure like this:

Cumulative Production =
CALCULATE (
SUM ( Table1[Production] ),
FILTER (
ALL ( Table1[Date] ),
Table1[Date] <= MAX ( Table1[Date] )
)
)

This measure will sum up the production values for all the dates that are less than or equal to the current date in the filter context.

To filter by another table’s column values, you need to have a relationship between the two tables. Then you can use the RELATED function or the USERELATIONSHIP function to access the values from the related table. For example, if you have a table called Table2 that has a column called Category, and you want to filter by Category = “A”, you can create a measure like this:

Cumulative Production by Category A =
CALCULATE (
[Cumulative Production],
Table1[Category] = RELATED ( Table2[Category] ),
Table2[Category] = "A"
)

This measure will use the existing relationship between Table1 and Table2 to filter by Category A.

Solved: How to filter in DAX using another column in a tab... - Microsoft Fabric Community

Solved: DAX help - filter another table based on value in ... - Microsoft Fabric Community

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Alf1507 ,

There is a  way to calculate cumulative productions is to use the CALCULATE function with the FILTER function and the ALL function. For example, you can create a measure like this:

Cumulative Production =
CALCULATE (
SUM ( Table1[Production] ),
FILTER (
ALL ( Table1[Date] ),
Table1[Date] <= MAX ( Table1[Date] )
)
)

This measure will sum up the production values for all the dates that are less than or equal to the current date in the filter context.

To filter by another table’s column values, you need to have a relationship between the two tables. Then you can use the RELATED function or the USERELATIONSHIP function to access the values from the related table. For example, if you have a table called Table2 that has a column called Category, and you want to filter by Category = “A”, you can create a measure like this:

Cumulative Production by Category A =
CALCULATE (
[Cumulative Production],
Table1[Category] = RELATED ( Table2[Category] ),
Table2[Category] = "A"
)

This measure will use the existing relationship between Table1 and Table2 to filter by Category A.

Solved: How to filter in DAX using another column in a tab... - Microsoft Fabric Community

Solved: DAX help - filter another table based on value in ... - Microsoft Fabric Community

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Ritaf1983
Super User
Super User

Hi @Alf1507 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.