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
adavid999
Helper V
Helper V

no calcular si ISBLANK

Hola, ¿cuál es la mejor manera de utilizar ISBLANK para cubrir dos medidas? Es decir, quiero dejar el resultado de [ventas de 2019] - [Ventas de 2018] en blanco, o no quiero calcular, si 2019 o 2018 está en blanco. Por el momento sólo está funcionando en 2019.

IF ( ISBLANK ( [2019 sales]) , BLANK() , [2019 sales] - [2018 sales])

Gracias

A

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@adavid999 en el caso de ambos, pruebe este

=IF ( ISBLANK ( [2019 sales]) || ISBLANK ( [2018 Sales] ), BLANK() , [2019 sales] - [2018 sales])

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.

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hola, @adavid999

Según su descripción, creé datos para reproducir su escenario.

Mesa:

c1.png

Puede probar las siguientes medidas.

2018Sales = SUM('Table'[2018 Sales])

2019Sales = SUM('Table'[2019 Sales])

Result1 = 
IF(
    OR(
        ISBLANK([2018Sales]),
        ISBLANK([2019Sales])
    ),
    BLANK(),
    [2019Sales]-[2018Sales]
)

Result2 = 
var tab = 
SUMMARIZE(
    'Table',
    'Table'[ID],
    'Table'[2018 Sales],
    'Table'[2019 Sales],
    "Result",
    IF(
        OR(
            ISBLANK('Table'[2018 Sales]),
            ISBLANK('Table'[2019 Sales])
        ),
        BLANK(),
        'Table'[2019 Sales]-'Table'[2018 Sales]
    )
)
return
SUMX(
    tab,
    [Result]
)

Resultado:

c2.png

Saludos

Allan

Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

aj1973
Community Champion
Community Champion

Hola

Es porque su IF está filtrando sólo en 2019.

Utilice la expresión en una función SUMX.

saludos

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

parry2k
Super User
Super User

@adavid999 en el caso de ambos, pruebe este

=IF ( ISBLANK ( [2019 sales]) || ISBLANK ( [2018 Sales] ), BLANK() , [2019 sales] - [2018 sales])

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.

Esto hizo el trabajo, gracias.

A

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.