cancel
Showing results for
Did you mean:

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Frequent Visitor

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

Tengo una mesa que se ve así:

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
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))``````
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.

Announcements

#### Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

#### Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

#### The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors