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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Cómo tener filtros con condición OR en Power Bi Desktop

Hola expertos,

Necesito usar una condición de filtro en la que quiero mostrar los datos de la siguiente manera:

Product.ProductName ="Apple"

o

Geography.Region = "US".

Necesito crear un filtro para lo mismo en Power Bi, pero no puedo crear un filtro con "O".

¿Podría sugerirme cómo puedo superar este desafío?

Gracias y saludos,

Tushar Gaurav

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Alta @तुषारगौरव

La solución @DataInsights ofrece es excelente y también puede considerar la siguiente solución.

Si desea controlar el filtro, puede crear una medida.

Measure =
IF (
    OR (
        SELECTEDVALUE ( 'Product'[ProductName] ) = "Apple",
        SELECTEDVALUE ( 'Geography'[Region] ) = "US"
    ),
    1,
    0
)

A continuación, coloque la medida en el filtro visual y establezca la condición de que la medida sea igual a 1.

vxinruzhumsft_0-1710829811427.png

¡Saludos!

Yolo Zhu

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

Syndicate_Admin
Administrator
Administrator

@TusharGaurav,

Pruebe esta medida:

OR Filter =
VAR vFilterTable =
    FILTER (
        CROSSJOIN ( ALL ( 'Product'[ProductName] ), ALL ( Geography[Region] ) ),
        'Product'[ProductName] = "Apple"
            || Geography[Region] = "US"
    )
VAR vResult =
    CALCULATE ( SUM ( FactTable[Amount] ), KEEPFILTERS ( vFilterTable ) )
RETURN
    vResult

https://www.sqlbi.com/articles/specifying-multiple-filter-conditions-in-calculate/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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