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.
Hola a todos
Tenemos una "Tabla de Descuento" que se parece un poco a esto:
Idproveedor | Languageid | ProductTypeID | WorkAreaID | DiscountSettings |
1 | 1 | 1 | 1 | 50% |
1 | 2 | 1 | 2 | 50% |
1 | 2 | 1 | 1 | 50% |
1 | 3 | 1 | 2 | 50% |
Luego tenemos una "tabla de ventas" que se parece un poco a esto:
JobID | Precio | Idproveedor | Languageid | ProductTypeID | WorkAreaID |
100 | 100 | 1 | 1 | 1 | 1 |
101 | 100 | 1 | 2 | 1 | 2 |
102 | 100 | 1 | 3 | 1 | 2 |
103 | 100 | 1 | 3 | 1 | 2 |
104 | 100 | 1 | 2 | 1 | 1 |
105 | 100 | 1 | 1 | 1 | 1 |
106 | 100 | 1 | 2 | 1 | 1 |
107 | 100 | 1 | 2 | 1 | 1 |
108 | 100 | 1 | 3 | 1 | 2 |
109 | 100 | 1 | 2 | 1 | 2 |
110 | 100 | 1 | 2 | 1 | 2 |
Me gustaría obtener un "Recuento de trabajos" y "Precio" para cada "Configuración" basado en la primera tabla.
Así que me gustaría una salida algo así:
Idproveedor | Languageid | ProductTypeID | WorkAreaID | DiscountSettings | Número de trabajos | Precio |
1 | 1 | 1 | 1 | 50% | 2 | 200 |
1 | 2 | 1 | 2 | 50% | 3 | 300 |
1 | 2 | 1 | 1 | 50% | 3 | 300 |
1 | 3 | 1 | 2 | 50% | 3 | 300 |
No estoy seguro de cómo combinar las tablas sin una "clave única".
Por lo tanto, un ejemplo para mí sería conocer el "Precio" y "Recuento de trabajos" para cada SupplierID-1, donde LanguageID-1, ProductTypeID-1, WorkAreaID-1 y DiscountSettings-50%.
Y entonces sólo necesitaría todas las combinaciones posibles.
¡Por favor, ayúdenme! 🙂
Solved! Go to Solution.
Hola @PeterStuhr ,
Intente crear medidas como las siguientes:
Price =
CALCULATE (
SUM ( 'Table (2)'[Price] ),
FILTER (
'Table (2)',
'Table (2)'[SupplierID] = MAX ( 'Table'[SupplierID] )
&& 'Table (2)'[ProductTypeID] = MAX ( 'Table'[ProductTypeID] )
&& 'Table (2)'[WorkAreaID] = MAX ( 'Table'[WorkAreaID] )
&& 'Table (2)'[LanguageID] = MAX ( 'Table'[LanguageID] )
)
)
Job count=
CALCULATE (
COUNT( 'Table (2)'[JobId] ),
FILTER (
'Table (2)',
'Table (2)'[SupplierID] = MAX ( 'Table'[SupplierID] )
&& 'Table (2)'[ProductTypeID] = MAX ( 'Table'[ProductTypeID] )
&& 'Table (2)'[WorkAreaID] = MAX ( 'Table'[WorkAreaID] )
&& 'Table (2)'[LanguageID] = MAX ( 'Table'[LanguageID] )
)
)
Saludos
Liang
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Hola @PeterStuhr ,
Intente crear medidas como las siguientes:
Price =
CALCULATE (
SUM ( 'Table (2)'[Price] ),
FILTER (
'Table (2)',
'Table (2)'[SupplierID] = MAX ( 'Table'[SupplierID] )
&& 'Table (2)'[ProductTypeID] = MAX ( 'Table'[ProductTypeID] )
&& 'Table (2)'[WorkAreaID] = MAX ( 'Table'[WorkAreaID] )
&& 'Table (2)'[LanguageID] = MAX ( 'Table'[LanguageID] )
)
)
Job count=
CALCULATE (
COUNT( 'Table (2)'[JobId] ),
FILTER (
'Table (2)',
'Table (2)'[SupplierID] = MAX ( 'Table'[SupplierID] )
&& 'Table (2)'[ProductTypeID] = MAX ( 'Table'[ProductTypeID] )
&& 'Table (2)'[WorkAreaID] = MAX ( 'Table'[WorkAreaID] )
&& 'Table (2)'[LanguageID] = MAX ( 'Table'[LanguageID] )
)
)
Saludos
Liang
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
@PeterStuhr concatenar columnas para crear una clave suplente para establecer la relación entre tablas y, a continuación, puede obtener datos de la tabla con bastante facilidad.
Me gustaría❤ elogiossi mi solución ayudara.👉Si puedes pasar tiempo publicando la pregunta, también puedes hacer esfuerzos para dar a Kudos quien haya ayudado a resolver tu problema. ¡Es una muestra de agradecimiento!
⚡Visítenos enhttps://perytus.com, su ventanilla única para proyectos/formación/consulta relacionados con Power BI.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
2 | |
2 | |
1 | |
1 | |
1 |