Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Mi Power BI real conectado con la base de datos SQL. En primer lugar, consulte el archivo adjunto. Bulk_production valor está relacionado con Dyelot no. Hay muchos tintes duplicados, no. Cuando se suma bulk_production valor con un valor duplicado que es mayor del valor real.
Necesita un DAX, si no hay un lote de tinte duplicado, aquí se contará un lote de tinte no y se contará el valor de bulk_production asociado.
https://drive.google.com/file/d/1bApfixcHSuPBGXH8ieJo5QU88CIjiTrj/view?usp=sharing
Duplicar dyelot no marcado con un color rojo, si dyelot no hay filas que tengan duplicado no, entonces bulk_production contar un valor y el valor de bulk_production de otros números de dyelot será 0. Al igual que Dyelot, ninguna 253126042 es doble. Aquí hay dos valores bulk_production, uno es 312 y otro es 312. Por lo tanto, uno será 312 y otro será 0. U oculte la columna de Dyelot no, Bulk_production y fecha de finalización. Por lo tanto, todo será igual cuando obtenga un tinte duplicado no. Dyelot no 253126042 columna será única y contará una vez.
Hola @Emranit
Espero haber entendido su problema correctamente, si desea conservar solo el producto a granel para el último tiempo de finalización, puede usar SUMX en una tabla virtual que devuelva la fila con la última hora de finalización y sumarlas. Estas dos medidas devolverán el mismo total y subtotales, pero resultados diferentes y el nivel de fila de la hora de finalización.
BulkProduct Latest Entry CALCULATE =
SUMX (
-- Summarize the filtered table
SUMMARIZE (
-- Filter for only the latest EndTime per Production Dyelot
FILTER (
Duplicate,
Duplicate[EndTime]
= CALCULATE (
-- Find the maximum EndTime, ignoring other filters except Production Dyelot
MAX ( Duplicate[EndTime] ),
ALLEXCEPT ( Duplicate, Duplicate[Production Dyelot] )
)
),
-- Group by Production Dyelot and Bulk_Production
Duplicate[Production Dyelot],
Duplicate[Bulk_Production]
),
-- Sum the Bulk_Production values
[Bulk_Production]
)
BulkProduct Latest Entry MAXX =
SUMX (
-- Iterate through the summarized table and sum the Bulk_Production values.
SUMMARIZE (
-- Summarize the table to group by Production Dyelot and filter only rows with the latest EndTime.
FILTER (
Duplicate,
-- Keep only rows where the EndTime is the latest for each Production Dyelot.
Duplicate[EndTime]
= MAXX (
FILTER (
Duplicate,
Duplicate[Production Dyelot] = EARLIER ( Duplicate[Production Dyelot] )
),
Duplicate[EndTime]
)
),
-- Define the grouping columns: Production Dyelot and Bulk_Production.
Duplicate[Production Dyelot],
Duplicate[Bulk_Production]
),
-- Specify the column to sum: Bulk_Production.
[Bulk_Production]
)
Sin embargo, si no necesita los registros duplicados, siga la sugerencia de @Ritaf1983.
Hola @Emranit
Para lograr el resultado deseado, si necesita estos duplicados y no puede simplemente eliminarlos de la tabla de datos, puede proporcionarles un índice por id de PQ :
Utilicé el método de la publicación del blog vinculada:
https://radacad.com/create-row-number-for-each-group-in-power-bi-using-power-query
A continuación, puede resumir las únicas filas con índice = 1
El pbix está conectado
Si esta publicación ayuda, considere aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.