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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Filter the calculated table

Hi everyone,

 

I have DAX problem. I'm tring to return only those rows from TABLE1 which have value in [Attribute] column is equal to TABLE2[name] value and TABLE1[project]  = TABLE2[project].

 

Attributes =

 

VAR All_attributes =
SELECTCOLUMNS (
'TABLE1';
"casx_id"; TABLE1[id];
"Attribute"; TABLE1[name];
"project"; TABLE1[project];)


RETURN
FILTER (
All_attributes;
[Attribute] IN VALUES ( TABLE2[name] ) && [project] IN VALUES ( TABLE2[project] ))  <-- it's not working

 

TABLE 1

casx_idAttributeproject
1aaax
2bbby
3cccx

 

TABLE 2

nameproject
aaax
bbby
cccz

 

 

Returned table should look like this: 

 

casx_idAttributeproject
1aaax
2bbby
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

create a new column in table like

New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project],table[name])

 

The rows you need is the one that has value

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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

3 REPLIES 3
Anonymous
Not applicable

@Anonymous 

For your expected table, you should used equal "=" instead of "in values", and it is not necessary to created a temporary table. 


Try the following calculated table. 

Table = CALCULATETABLE(VALUES(Table1),FILTER(Table1,[Attribute] = RELATED(Table2[name])&&[project]=RELATED(Table2[project])))

 

Paul Zheng

amitchandak
Super User
Super User

create a new column in table like

New column in Table 1 = maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project],table[name])

 

The rows you need is the one that has value

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/Winner-Topper-on-Map-How-to-Color-States-on-a-Map-wi...
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

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
Anonymous
Not applicable

amitchandak thank you for your answer ! It's working. But maybe you have idea how to put your formula:

 

 maxx(filter(table2,table1[Attribute] = table2[name] && table1[project] = table2[project],table[name])

 

into my script which create new table (below I put simplified script, the orginal script have unions ect.):

 

Attributes =

VAR All_attributes =
SELECTCOLUMNS (
'TABLE1';
"casx_id"; TABLE1[id];
"Attribute"; TABLE1[name];
"project"; TABLE1[project];)

RETURN
All_attributes

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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