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
314mp_M0th4
Resolver I
Resolver I

Filter values in one table column based on values in a different table column.

I have two tables, one for project costs for numerous projects and the other with cost plans for the projects. All the projects have real cost but not all projects have a cost plan. I want to either make a calculated table with all projects real costs for projects that also have a cost plan or some filter that does this in a measurement. Is this possible?

 

Thanks.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@314mp_M0th4 , You can have measure like

 

calculate(sum(Table1[Values]), filter(Table1, Table1[Project] in values(Table2[Values]) ))

 

or use Treatas

https://docs.microsoft.com/en-us/dax/treatas-function

 

or Create common  dimensions

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

 

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @314mp_M0th4 ,

I created some data:

TableA:

vyangliumsft_0-1693883497585.png

TableB:

vyangliumsft_1-1693883497587.png

Calculated table:
Table =
var _table1=
SUMMARIZE(
    'TableB',
    'TableB'[Projects],'TableB'[cost plan],"real projects",
    MINX(
        FILTER(ALL(TableA),
        'TableA'[Projects]=EARLIER('TableB'[Projects])),'TableA'[real cost]))
return
FILTER(
    _table1,[real projects]<>BLANK())

vyangliumsft_2-1693883514712.png

Measure.

Measure =
MINX(
    FILTER(ALL(TableA),
    'TableA'[Projects]=MAX('TableB'[Projects])),[real cost])

vyangliumsft_3-1693883514713.png

 

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@314mp_M0th4 , You can have measure like

 

calculate(sum(Table1[Values]), filter(Table1, Table1[Project] in values(Table2[Values]) ))

 

or use Treatas

https://docs.microsoft.com/en-us/dax/treatas-function

 

or Create common  dimensions

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

 

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!

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.