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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Crear los últimos x días /semanas/mes en el filtro desplegable

Hola

Estoy buscando crear un filtro de fecha desplegable con opciones como ;

date period.PNGFiltro

Los últimos 7 días

Las últimas 2 semanas

El mes pasado

... y así sucesivamente

Esto actuará como un filtro de fecha en los objetos visuales respectivos. Por favor, hágamelo saber si esto es posible en PowerBI

.

1 ACCEPTED SOLUTION
v-diye-msft
Community Support
Community Support

No @shubhy04

Puede crear varias medidas en la lista de la

Últimos 7 días

Últimas 2 semanas

El mes pasado

... y así sucesivamente

y luego intente algo como esto:

Valor final 1 = 
IF(HASONEFILTER(Table[slicer]),
    SWITCH(SELECTEDVALUE(Table[slicer]),
        "Last 7 days", [Measure 1],
        "Last 2 weeks", [Measure 2],
        "Last month", [Measure 3]
    ),
   BLANK()
)

aquí también hay otros hilos similares podrían ser su referencia:

https://community.powerbi.com/t5/Desktop/Control-Range-Date-by-Dropdown-filter/m-p/977818

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
v-diye-msft
Community Support
Community Support

No @shubhy04

Puede crear varias medidas en la lista de la

Últimos 7 días

Últimas 2 semanas

El mes pasado

... y así sucesivamente

y luego intente algo como esto:

Valor final 1 = 
IF(HASONEFILTER(Table[slicer]),
    SWITCH(SELECTEDVALUE(Table[slicer]),
        "Last 7 days", [Measure 1],
        "Last 2 weeks", [Measure 2],
        "Last month", [Measure 3]
    ),
   BLANK()
)

aquí también hay otros hilos similares podrían ser su referencia:

https://community.powerbi.com/t5/Desktop/Control-Range-Date-by-Dropdown-filter/m-p/977818

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
MFelix
Super User
Super User

Hola @shubhy04 ,

Cree que necesita crear una tabla auxiliar con la información y luego hacer una medida de cambio para filtrar su información algo similar a:

Id Tipo Período Tipo de período
1 La semana pasada 7 Día
2 Las últimas 2 semanas 7 Día
3 El mes pasado 1 Mes

A continuación, haga una fórmula similar a:

Measure =
CALCULATE (
    [Measure],
    SWITCH (
        SELECTEDVALUE ( Table[ID] ),
        1, FILTER (
            ALL ( DateTable ),
            DateTable[Date] <= MAX ( DateTable[Date] )
                && DateTable[Date] <= DATEADD ( DateTable[Date], - MAX ( Table[Period] ), DAY ),
2, .....

        )
    )
)

Así que puedes añadir fechas dinamísticamente.

Si desea más detalles, ¿puede compartir un ejemplo de datos?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.