Forum Discussion
Doubt filter segmentation
- Anonymous3 years ago
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.
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.