Forum Discussion

carolinesbp_'s avatar
carolinesbp_
Regular Visitor
2 years ago

RELATIONSHIP USING TREATAS

Hey guys!!
I need to relate two tables, the METAS table and the CONTRACTS table.
Both have a relationship with the calendar table, so I can't relate them directly.
I created a new table containing the seller columns and related both to this table and it returned an active relationship, but any other column or even creating a new table, Power BI does not allow the relationship.

With this, I created a measure using treatas:
Novos Clientes =
CALCULATE(
COUNTROWS(CRM_CONTRATOS),
CRM_CONTRATOS[ClassificacaoCliente] = "Novo",
TREATAS(
VALUES(CRM_CONTRATOS[LINHA]),
'01. Meta'[Linha]
),
TREATAS(
VALUES(CRM_CONTRATOS[ProdutoGPOM]),
'01. Meta'[Serviço]
)
)

This formula returns the expected result, but the filters in the METAS table columns do not work to filter this measure.
Example:
The filters for the saller and teams columns filter correctly, but the service and location do not filter this measure correctly.
as below: it filters correctly
IMAGE 01

but when I filter with another filter it doesn't work. he doesn't even filter
IMAGEM 02


all filters come from the METAS table.
The rek?lationship is like this

IMAGEM 03.


What can I do to fix this? There is another method for filters and relationships to worK?

3 Replies