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

Creación de % de varianza en el Editor tabular utilizando grupos calculados

Hola a todos

No está seguro de si este es el lugar correcto para publicar, estamos usando grupos calculados en el Editor tabular con Power BI. Estamos tratando de crear un grupo de calcuación % de varianza para el beneficio bruto.

He creado una medida en Power BI para la varianza:

[NZD real] - [Presupuesto NZD]

Mis cálculos de Tabular Editor para Ingresos individuales y Ganancias Brutas:

CALCULATE( SELECTEDMEASURE(),
    'Account'[Account Level 9 Text] IN { "Total Revenue" }
) / 1000
CALCULATE( SELECTEDMEASURE(),
    'Account'[Account Level 9 Text] IN { "Total Gross Profit" }
) / 1000

Mi calcación para el %beneficio bruto:

DIVIDE( CALCULATE( SELECTEDMEASURE(), 
    'Measure Selector'[Measure Selector] = "Total Gross Profit" ),
    CALCULATE( SELECTEDMEASURE(), 
    'Measure Selector'[Measure Selector] = "Total Revenue" ) )

Cuando publico en el informe de Power BI, no se calcula correctamente. Parece que está calcuando por la columna para "Var Act v Bud" en lugar de la fila. El 128% debe ser del 63,9%.

TheBlacklist_0-1596489695921.png

¿Cómo obtengo esto para calcular correctamente?

Gracias por tu ayuda

4 REPLIES 4
parry2k
Super User
Super User

@TheBlacklist probar esto

DIVIDE( CALCULATE( SELECTEDMEASURE(), 
'Account'[Account Level 9 Text] IN { "Total Gross Profit" }
 
    CALCULATE( SELECTEDMEASURE(),     'Account'[Account Level 9 Text] IN { "Total Revenue" }
     )

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 relacionadas 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.

Anonymous
Not applicable

@parry2k Gracias por la respuesta. Desgraciadamente, todavía no está del todo bien. El presupuesto real y el presupuesto calculan de forma favorable, pero no la desviación.

(Tenía que exportar a Excel para mostrar algunos números falsos)

TheBlacklist_0-1596504235899.png

Hola @TheBlacklist

Si tiene datos a continuación, cree medidas

Capture6.JPG

actual_number = CALCULATE(SUM('Table 4'[Value]),FILTER('Table 4','Table 4'[cate]="actual"))

budget_number = CALCULATE(SUM('Table 4'[Value]),FILTER('Table 4','Table 4'[cate]="budget"))

total =
DIVIDE (
    CALCULATE (
        SUM ( 'Table 4'[Value] ),
        FILTER ( 'Table 4', 'Table 4'[account level] = "gross profit" )
    ),
    CALCULATE (
        SUM ( 'Table 4'[Value] ),
        FILTER ( 'Table 4', 'Table 4'[account level] = "revenue" )
    )
)


vs_number = [budget_number]-[actual_number]

actual _text =
IF (
    ISINSCOPE ( 'Table 4'[account level] ),
    FORMAT ( [actual_number], "General Number" ),
    FORMAT ( CALCULATE ( [total], 'Table 4'[cate] = "actual" ), "Percent" )
)

budget_text =
IF (
    ISINSCOPE ( 'Table 4'[account level] ),
    FORMAT ( [budget_number], "General Number" ),
    FORMAT ( CALCULATE ( [total], 'Table 4'[cate] = "budget" ), "Percent" )
)


vs_text =
IF (
    ISINSCOPE ( 'Table 4'[account level] ),
    FORMAT ( [budget_number] - [actual_number], "General Number" ),
    FORMAT (
        CALCULATE ( [total], 'Table 4'[cate] = "actual" )
            - CALCULATE ( [total], FILTER ( 'Table 4', 'Table 4'[cate] = "budget" ) ),
        "Percent"
    )
)

Saludos
Maggie
Equipo de apoyo a la comunidad _ Maggie Li
Si este post ayuda, entonces considera Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

@TheBlacklist es posible enviar algunos datos de muestra, me gustaría probarlos y volver a usted.

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 relacionadas 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.

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.

Top Kudoed Authors