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
Marshy
Frequent Visitor

Filtro de días atrás (1,7,28)

Tengo una mesa que se ve así:

Marshy_0-1593679903685.png

Quiero ser capaz de hacer un filtro personalizado o segmentación de datos que dice si 1 a continuación, calcular la columna ship_visit_1d
si 7 luego calcular la columna ship_visit_7d
si 28 luego calcular la columna ship_visit_28d

No puedo por mi vida resolver esto, ¿alguien puede ayudar?

Tia

2 REPLIES 2
amitchandak
Super User
Super User

@Marshy , consulte si esto puede ayudar a

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

Rolling 7 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD(Table,today()-7,7,day))
Rolling 7 to 14 day = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD(Table,today()-14,7,day))

7 Days behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-7,DAY))
14 Days behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-7,DAY))
21 Days behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-7,DAY))
Mariusz
Community Champion
Community Champion

Hola @Marshy

1. Cree una tabla con las filas de árbol 1, 7 y 28.

2 Crear medida:

result = 
SWITCH(
    SELECTEDVALUE( SelectionTable[selection] ),
    1, SUM( table[ship_visit_1d] ),
    7, SUM( table[ship_visit_7d] ),
    28, SUM( table[ship_visit_28d] )
)

Saludos
Mariusz

Si este post ayuda, entonces considere aceptarlo como la solución.

Por favor, siéntase libre de conectarse conmigo.
Linkedin

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.