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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
umutkaya79
Helper I
Helper I

Getting a value from a second table by filtering from the first table

Hi,

 

I have 2 tables : 1)'Exposure - All' and 2)'tbExtractFMTenant'.

1)'Exposure - All'  has columns : 'exposure_analysis_group' and  'tenant_name'. Every 'exposure_analysis_group' has a specific tenant_name.

2)'tbExtractFMTenant' columns : tenant_name and 'trend_query_margin'. every ''tenant_name'' has their specific 'trend_query_margin'. I have a slicer from the 'exposure_analysis_group' column. I want to get the 'trend_query_margin' based on the 'exposure_analysis_group' selection. 

 

Example: 

'Exposure - All' table :    'exposure_analysis_group'         'tenant_name'

                                                        1                                          x

                                                        2                                          y

                                                        3                                          z

 

tbExtractFMTenant' table :  trend_query_margin             'tenant_name'

                                                       5.50                                     x

                                                       6.50                                     y

                                                       7.50                                     z

 

Trying to get the trend_query_margin  based on the 'exposure_analysis_group'  slicer selection.

There are no active relationships between these 2 tables and we don't want active relationship.

 

Wrote a dax but doesn't give me the trend_query_margin based on the 'exposure_analysis_group' slicer :

 

Margin =
VAR SelectedGroup = SELECTEDVALUE('Exposure - All'[exposure_analysis_group])
RETURN
CALCULATE(
MAX('tbExtractFMTenant'[trend_query_margin]),
FILTER('tbExtractFMTenant', 'tbExtractFMTenant'[tenant_name] = SelectedGroup)
)
 
If someone have any advise please. Thank you 

 

1 REPLY 1
amitchandak
Super User
Super User

@umutkaya79 , Try like

 

Margin =
VAR SelectedGroup = values('Exposure - All'[exposure_analysis_group])
RETURN
CALCULATE(
MAX('tbExtractFMTenant'[trend_query_margin]),
FILTER('tbExtractFMTenant', 'tbExtractFMTenant'[tenant_name] in  SelectedGroup)
)

 

of exploring treatas

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

https://www.sqlbi.com/articles/propagate-filters-using-treatas-in-dax/

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.