Forum Discussion
Svillanueva94
5 years agoRegular Visitor
Calculus between 2 unrelated tables
Hi, everyone! My problem is that I want to make some math between two tables that have no relation. The first table only contains: Column Example Service Processing Total cost ...
- Anonymous5 years ago
Hi Svillanueva94 ,
Based on your description, I created two sample table and did a test. I can reproduce your issue.
So I create a new measure as follows.
Measure =
var x1=SUMX(FILTER(ALL('AA_Costos'),[Servicio]="Procesamiento"),[Pagado en Pesos SIN IVA])
var x2=CALCULATE(SUM('Autorizaciones'[Autorizaciones]),ALL())
var x3=x1/x2
return
SUMX(FILTER(ALL(Autorizaciones),[IdCliente]=SELECTEDVALUE(Autorizaciones[IdCliente])),[Autorizaciones])*x3Result:
Hope that's what you were looking for.
Best Regards,
Yuna
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
selimovd
Most Valuable Professional
5 years agoHey Svillanueva94 ,
maybe show us your tables, the result and the measures you used.
Then it's easier to help you.
In general when you want to compare things from 2 different table you can use data linage.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Svillanueva94
5 years agoRegular Visitor
The Measure that gets the total costs:
Total Procesamiento = CALCULATE(SUM(AA_Costos[Pagado en Pesos SIN IVA]),AA_Costos[Servicio] = "Procesamiento") -- the amount is 3M
The Measure that gets the total sales:
Total autorizaciones # = CALCULATE( SUM(Autorizaciones[Autorizaciones])) -- the amount is 8.5M
The Measure that gets the unitary cost:
Unitario Procesamiento = [Total Procesamiento] / [Total autorizaciones #] -- the amount is 0.35
The last Measure, it tries to get the cost for each client:
Procesamiento = CALCULATE(SUM(Autorizaciones[Autorizaciones])) * [Unitario Procesamiento]
But, when I put then in a table, the Measure Procesamiento and the client is not working:
This are the screen shots of the tables:
The first table, with the costs (AA_Costos):
The second table, containing the sales of each Client (Autorizaciones):