Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Total muestra en blanco con medida calculada

Hola

Estoy luchando con mi medida. La medida funciona correctamente con cada fila. Pero la fila total de la tabla no muestra nada (BLANK()). La sintaxis de mi medida se adjunta a continuación.

Participación en el beneficio de la devolución a KH

IF( SELECTEDVALUE( Shipment[CompanyCode],BLANK()) á "JWDA",
BLANK(),

CALCULATE(SUMX(Envío,
(Envío[ProfitSharePercent]/100) * ([Beneficio bruto])),
FILTRO( TODO (Envío),
Envío[Trabajo maestro No] - MAX(Envío[No de trabajo maestro])),
FILTRO( TODO( 'Maestro de la Empresa'),
'Company Master'[ID de empresa] <> "JWDAC"),
FILTRO(ALL(Envío),
Envío[ProfitShareTo] - "CAMBODIA")))
Además, he intentado usar IF( HASONEVALUE()) pero parece que es algo incorrecto cuando utilizo el filtro externo, por ejemplo, la segmentación con los períodos de tiempo.

7 REPLIES 7
v-shex-msft
Community Support
Community Support

HI @Paniti,

Puede intentar utilizar la siguiente fórmula de medida si es adecuada para sus necesidades:

Return Profit Share to KH =
VAR CompanyList =
    CALCULATETABLE (
        VALUES ( 'Company Master'[Company ID] ),
        FILTER ( ALL ( 'Company Master' ), 'Company Master'[Company ID] <> "JWDAC" )
    )
VAR currJob =
    MAX ( Shipment[Master Job No] )
RETURN
    IF (
        ISFILTERED ( Shipment[Master Job No] ),
        "detail level",
        IF (
            NOT ( "JWDA" IN VALUES ( Shipment[CompanyCode] ) ),
            CALCULATE (
                SUMX ( Shipment, Shipment[ProfitSharePercent] / 100 * [Gross Profit] ),
                FILTER (
                    ALL ( Shipment ),
                    Shipment[Master Job No] = currJob
                        && Shipment[ProfitShareTo] = "CAMBODIA"
                        && Shipment[CompanyCode] IN CompanyList
                )
            )
        )
    )

Si la anterior no ayuda, por favor comparta algunos datos ficticios con la misma estructura para probar:

Cómo obtener respuesta rápida a su pregunta

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Querido @amitchandak @v-shex-@nandukrishnavs @amitchandak @nandukrishnavs

Por favor, encuentre el siguiente archivo pbix para su información Dummy BI

Gracias de antemano.

@Paniti

A continuación se presentan mis hallazgos.

  • MAX ( Envío[Trabajo maestro No] ) es JTH-2005-0072
  • Si verifica el beneficio bruto de JTH-2005-0072, puede encontrarlo en blanco.
¿Cuál es la lógica real para identificar el MAX de [Master Job No]?
Sólo para fines de prueba he modificado su lógica como abajo.

Return Profit Share to KH = 

IF( SELECTEDVALUE( Shipment[CompanyCode],BLANK()) = "JWDA", 
// This measure will return BLANK() when JWD TH's jobs are calculated
    BLANK(),

    CALCULATE(SUMX(Shipment,
        (Shipment[ProfitSharePercent]/100) * ([Gross Profit])),
            // Match the related master job numbers
            FILTER( ALL(Shipment),  
                Shipment[Master Job No] IN DISTINCT('Job Order'[MasterJobNo])),
            // Retreive the profit that share from JWD TH only
            FILTER( ALL( 'Company Master'),
                'Company Master'[Company ID] <> "JWDAC"),
            
            FILTER(ALL(Shipment),
                Shipment[ProfitShareTo] = "CAMBODIA")))

Capture.JPG


¿Respondí a tu pregunta? ¡Marca mi puesto como solución!
Apreciar con un kudos
🙂

Aquí está mi último blog

https://community.powerbi.com/t5/Community-Blog/Dynamic-Page-Navigation-Based-on-User-Login/ba-p/109...


Regards,
Nandu Krishna

Anonymous
Not applicable

Queridos @nandukrishnavs

Me gustaría filtrar los trabajos que tienen el mismo MasterJobNo. De todos modos, tu post me resuelve.

Gracias y mejores saludos,

amitchandak
Super User
Super User

@Paniti , ¿Puede compartir datos de ejemplo y salida de ejemplo en formato de tabla? O un pbix de muestra después de eliminar datos confidenciales.

Este ejemplo de cambio calc basado en el valor seleccionado

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...

referir a este documento cómo hasonevalue

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

isinscope

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Anonymous
Not applicable

Queridos @amitchandak

La salida de mi medida está en la imagen de abajo. Me gustaría que la medida "Return Profit Share to KH" muestre un gran total en la parte inferior de la tabla.

Capture.PNGSalida de la medida calculada

¿Puedo saber cómo adjuntar pbix a este post?

Saludos

@Paniti

Prueba esto

Return Profit Share to KH =
VAR maxVal =
    CALCULATE (
        MAX ( Shipment[Master Job No] ),
        ALL ( Shipment )
    )
VAR result =
    CALCULATE (
        SUMX (
            Shipment,
            ( Shipment[ProfitSharePercent] / 100 ) * ( [Gross Profit] )
        ),
        FILTER (
            ALL ( Shipment ),
            Shipment[Master Job No] = maxVal
        ),
        FILTER (
            ALL ( 'Company Master' ),
            'Company Master'[Company ID] <> "JWDAC"
        ),
        FILTER (
            ALL ( Shipment ),
            Shipment[ProfitShareTo] = "CAMBODIA"
        )
    )
RETURN
    IF (
        SELECTEDVALUE (
            Shipment[CompanyCode],
            BLANK ()
        ) <> "JWDA",
        result
    )



¿Respondí a tu pregunta? ¡Marca mi puesto como solución!
Apreciar con un kudos
🙂

Aquí está mi último blog

https://community.powerbi.com/t5/Community-Blog/Dynamic-Page-Navigation-Based-on-User-Login/ba-p/109...


Regards,
Nandu Krishna

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.