Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Estimados, necesito por favor vuestra ayuda para encontrar alguna fórmula que me permita sumar datos de una columna pero según los criterios de otra. La condición es que sume solo si encuentra que el dato es único en la columna criterio.
Dato 1 | Criterio |
10 | 45001201 |
20 | 45001202 |
30 | 45001203 |
40 | 45001204 |
100 |
Debe sumar solo una vez los datos de las primeras dos filas dado que en la columna criterio se repite un valor dos veces, por tanto debe considerar una sola vez.
Espero haberlo explicado bien y que me puedan ayudar.
Gracias!
Solved! Go to Solution.
Try this:
1) Calculate the average of your "Criterio":
Average = AVERAGE(Criterio[Dato 1])
2) Use SUMX with DISTINCT to sum these average values
Suma sin duplicados = SUMX(DISTINCT(Criterio[Criterio]); [Average])
To get this result:
Proud to be a Super User!
Paul on Linkedin.
Hi @JDU ,
Maybe you can try this:
Column =
VAR x =
CALCULATE(
COUNT([Criterio]),
ALLEXCEPT(
table,
[Dato 1]
)
)
RETURN
IF(
x = 1,
ADDCOLUMNS( )
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
An error appears with the expression "ADDCOLUMNS".
Please don't forget that what I need is to add up the data in the "Dato 1" column if the values in the "Criterio" column are different.
Anyway, thank you very much for your help!
but, how do I relate the data from the new table to the table I need to add?
What I need to do is add up the values in one column if the values in another column are unique. When I create a new table with unique values I can't relate it to the original table.
I probably don't know how to do it.
Try this:
1) Calculate the average of your "Criterio":
Average = AVERAGE(Criterio[Dato 1])
2) Use SUMX with DISTINCT to sum these average values
Suma sin duplicados = SUMX(DISTINCT(Criterio[Criterio]); [Average])
To get this result:
Proud to be a Super User!
Paul on Linkedin.
The solution looks good, it's just what I need but I can't execute it. Consultations:
1) The average I create as a new column ... I do not get the same results as you.
2) SUMX I use it as a new measure?
Thanks for your help!
They are 2 seperate measures (no new columns)..
Proud to be a Super User!
Paul on Linkedin.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
96 | |
77 | |
66 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |