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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Syndicate_Admin
Administrator
Administrator

Doubt filter segmentation

Good

I am making a series of graphs about workers in a company and I want to add a filter (data segmentation) according to the country of the center in which they work.

A person can be associated with 2 types of center: the work center and the research center, and each of them is reached from different data sources. This is in 2 tables: centro_trabajo and centro_investigación, and both have a field called id_país, which relates to a dimension_pais table.

My problem is that I cannot relate each of the tables to the size of the country since one of the relationships remains inactive. My idea is to have a segmentation so that, if for example, I select the country "Spain" I get the data of people whose work center is in Spain or their research center is in Spain.

I do not know if I finish explaining, but joining in the same table the research center and the work center is not an option since both are reached by different data sources.

Greetings and thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Damiaaaannnn ,

 

If you have an inactive relationship between two tables in Power BI Desktop, you can still use the fields from both tables in your report by creating a new measure or calculated column that uses the inactive relationship. You can use the USERELATIONSHIP function to specify the inactive relationship in your measure or calculated column.

For example, if you have a table called centro_trabajo and a table called centro_investigación, and both tables have a field called id_país that relates to a dimension_pais table, you can create a measure that uses the id_país field from the centro_investigación table and the id_país field from the dimension_pais table, even if the relationship between the centro_investigación table and the dimension_pais table is inactive.

To create a measure that uses the inactive relationship, you can use the following formula:

Measure = CALCULATE(SUM(Table1[Column1]), USERELATIONSHIP(Table2[Column2], Dimension[Column3]))

In this formula, Table1 is the table that contains the data you want to aggregate, Column1 is the column you want to aggregate, Table2 is the table that has the inactive relationship with the dimension table, Column2 is the column in Table2 that relates to the id_país field in the dimension table, and Column3 is the id_país field in the dimension table.

Once you have created the measure, you can use it in your report to filter data based on the country of the center in which the workers work. You can create a slicer based on the id_pais field in the dimension_pais table, and use this slicer to filter data in both the centro_trabajo and centro_investigación tables.

I hope this helps! Let me know if you have any further questions.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Damiaaaannnn ,

 

If you have an inactive relationship between two tables in Power BI Desktop, you can still use the fields from both tables in your report by creating a new measure or calculated column that uses the inactive relationship. You can use the USERELATIONSHIP function to specify the inactive relationship in your measure or calculated column.

For example, if you have a table called centro_trabajo and a table called centro_investigación, and both tables have a field called id_país that relates to a dimension_pais table, you can create a measure that uses the id_país field from the centro_investigación table and the id_país field from the dimension_pais table, even if the relationship between the centro_investigación table and the dimension_pais table is inactive.

To create a measure that uses the inactive relationship, you can use the following formula:

Measure = CALCULATE(SUM(Table1[Column1]), USERELATIONSHIP(Table2[Column2], Dimension[Column3]))

In this formula, Table1 is the table that contains the data you want to aggregate, Column1 is the column you want to aggregate, Table2 is the table that has the inactive relationship with the dimension table, Column2 is the column in Table2 that relates to the id_país field in the dimension table, and Column3 is the id_país field in the dimension table.

Once you have created the measure, you can use it in your report to filter data based on the country of the center in which the workers work. You can create a slicer based on the id_pais field in the dimension_pais table, and use this slicer to filter data in both the centro_trabajo and centro_investigación tables.

I hope this helps! Let me know if you have any further questions.

 

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors