Forum Discussion
reiskleiton
5 years agoHelper II
USERELATIONSHIP
Hi all, I have tried to get data from one table based on another by using USERELATIONSHIP function. I need to get all the data that matches from CAR and Ordens Bloq tables on columns [Mês e ...
- 5 years ago
Hi reiskleiton ,
Looking at the data you have given beliw you can do it adding the following measure:
Excesso de limite = CALCULATE(SUM(CAR[Montante]); CAR[Cliente] in VALUES('Ordem Bloq'[Cliente]))Check result in attach PBIX.
MFelix
5 years agoSuper User
Hi reiskleiton ,
Your issue is that you have a many to many relationship between both you tables, this returns more than one result for each side.
I don't know if you have a dimension table with unique [Cliente] but if you create a dimension table with [Cliente] and then make a one to many with the other to tables (has you have calendar table) then you can simply make the direct sum without the need for USERELATIONSHIP.
reiskleiton
5 years agoHelper II
Hi MFelix
Yes, I do have a Cliente dimension table.
How should I SUM CAR[Montante] by Filter CAR[Cliente] = Orden Bloq[CLIENTE] AND both same Calendario[Mês e Ano]?
Thank you