March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hola favor ayuda en el siguiente caso:
Me piden agrupar los siguientes productos como una oferta en factura , los productos deben estar juntos en la misma factura para considerarse una oferta.
En una tabla por factura se debe mostrar cuantas ofertas estaban presentes
y poder decir cuantas ofertas fueron vendidas.
Saludos
Solved! Go to Solution.
Hi @GenZam1988
Thanks for your reply.
Based on your description, you can refer to the following solution.
1.Remove the relationship between the tables(there is no relationship between the tables)
2.Create the following measures.
MEASURE =
VAR a =
MAXX (
FILTER ( 'Table', [Producto] = MAX ( 'Table (2)'[Articulo] ) ),
[Oferta]
)
VAR b =
SUMMARIZE ( FILTER ( ALLSELECTED ( 'Table' ), [Oferta] = a ), [Producto] )
VAR c =
CALCULATE (
DISTINCTCOUNT ( 'Table (2)'[Articulo] ),
ALLSELECTED ( 'Table (2)'[Articulo], 'Table (2)'[Numbero Factura] ),
REMOVEFILTERS ( 'Table (2)'[Cantidad] ),
'Table (2)'[Articulo] IN b,
'Table (2)'[Numbero Factura] IN VALUES ( 'Table (2)'[Numbero Factura] )
)
RETURN
IF ( COUNTROWS ( b ) = c, a )
Measure2 =
CALCULATE (
SUM ( 'Table (2)'[Cantidad] ),
FILTER ( 'Table (2)', [Measure] IN VALUES ( 'Table'[Oferta] ) )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @GenZam1988
Based on your description and the picture, you just need to create a relationship between the tables.
Then you can use a table visual to display the cantidads
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply.
But I need to find a way if the 2 products in the offer are together on the invoice it is considered an Offer, in the scenario that you tell me if there is only one product it is also taken as an offer.
It is mandatory that both products be together to be an offer
Hi @GenZam1988
Thanks for your reply.
Based on your description, you can refer to the following solution.
1.Remove the relationship between the tables(there is no relationship between the tables)
2.Create the following measures.
MEASURE =
VAR a =
MAXX (
FILTER ( 'Table', [Producto] = MAX ( 'Table (2)'[Articulo] ) ),
[Oferta]
)
VAR b =
SUMMARIZE ( FILTER ( ALLSELECTED ( 'Table' ), [Oferta] = a ), [Producto] )
VAR c =
CALCULATE (
DISTINCTCOUNT ( 'Table (2)'[Articulo] ),
ALLSELECTED ( 'Table (2)'[Articulo], 'Table (2)'[Numbero Factura] ),
REMOVEFILTERS ( 'Table (2)'[Cantidad] ),
'Table (2)'[Articulo] IN b,
'Table (2)'[Numbero Factura] IN VALUES ( 'Table (2)'[Numbero Factura] )
)
RETURN
IF ( COUNTROWS ( b ) = c, a )
Measure2 =
CALCULATE (
SUM ( 'Table (2)'[Cantidad] ),
FILTER ( 'Table (2)', [Measure] IN VALUES ( 'Table'[Oferta] ) )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
58 | |
52 |
User | Count |
---|---|
196 | |
125 | |
107 | |
68 | |
65 |