Forum Discussion
Problems how many order by category
- 3 years ago
hi, mmunozi1984
i think there are some confusion
let's break your code and try to know what output isso
ADDCOLUMNS(SUMMARIZE('Categorias',Categorias[NombreCategoria]),"pedidos",CALCULATE(COUNTROWS(RELATEDTABLE('Detalles de pedidos'))))give output like below (i am calculate new table )it give you a table which contain 8 rows (distinct value of NombreCategoria)
and count of related rows from table Detalles de pedidos.
these same answer given by my formula
in below code
COUNTROWS(FILTER([Pedidos] > 0))an you try to count rows of above table(in above image)
which contain 8 distinct rows of NombreCategoria (not rows present in table Detalles de pedidos)
so it give 1 value in NombreCategoria and total 8 (because 8 rows present in above table).
you use [Pedidos] > 0 but no value(count) below zero
I hope you clear what i want to sayIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly. and don't forget to give kudos.
- 3 years ago
Hi, mmunozi1984
i hope you understand what i try to explain
and now your desired output is belowresult =var a = CALCULATE(COUNTROWS(Pedidos),RELATEDTABLE('Detalles de pedidos'))return adownload .pbix file HERE
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. and don't forget to give kudos.
hi, mmunozi1984
i think there are some confusion
let's break your code and try to know what output is
so
it give you a table which contain 8 rows (distinct value of NombreCategoria)
and count of related rows from table Detalles de pedidos.
these same answer given by my formula
in below code
an you try to count rows of above table(in above image)
which contain 8 distinct rows of NombreCategoria (not rows present in table Detalles de pedidos)
so it give 1 value in NombreCategoria and total 8 (because 8 rows present in above table).
you use [Pedidos] > 0 but no value(count) below zero
I hope you clear what i want to say
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. and don't forget to give kudos.
Hi, mmunozi1984
i hope you understand what i try to explain
and now your desired output is below
download .pbix file HERE
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. and don't forget to give kudos.