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
Anonymous
Not applicable

Creación de la selección de períodos de tiempo más recientes a partir de la fecha del calendario

¿Hay alguna manera de mostrar los últimos marcos de tiempo 4, 12, 52 e YTD como un menú desplegable en la vista de informe para que el usuario pueda seleccionar de ella? Aquí está mi tabla Calendario y el dax que estoy tratando de hacer pero todavía no funciona:

¡Gracias por la ayuda!

2 REPLIES 2
Fowmy
Super User
Super User

@Housseyn

El código de selección de fecha que mostró se supone que es una tabla, no una columna en la tabla de fechas. tienes que ir a la pestaña Modelado > Nueva tabla y Pegar.

Sin embargo, puede consultar el siguiente vídeo y ajustar según sus necesidades.

https://www.youtube.com/watch?v=AdLDYohLeJc

________________________

Si mi respuesta fue útil, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla

Haga clic en el icono Thumbs-Up si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks Fowmy. I tried the DAX in table instead of column but still showing #ERROR. Any idea how we can fix this ? 

 

Periods Selection =
VAR LatestDate = MAX('Calendar'[Date])
VAR YearStart = calculate(STARTOFYEAR('ATLAS_Retail Sales'[Week Ending]),YEAR('ATLAS_Retail Sales'[Week Ending])= YEAR(LatestDate))
VAR L12Start = CALCULATE(LASTDATE('ATLAS_Retail Sales'[Week Ending])-84)
VAR L4Start = CALCULATE(LASTDATE('ATLAS_Retail Sales'[Week Ending])-28)
var LWStart = CALCULATE(LASTDATE('ATLAS_Retail Sales'[Week Ending])-7)
VAR L52Start = CALCULATE(LASTDATE('ATLAS_Retail Sales'[Week Ending])-365)

VAR Result =
UNION(
ADDCOLUMNS(
CALENDAR(YearStart, LatestDate),
"Selection","YTD"
),
ADDCOLUMNS(
CALENDAR(L12Start, LatestDate),
"Selection","L12"
),
ADDCOLUMNS(
CALENDAR(L4Start, LatestDate),
"Selection","L4"
),
ADDCOLUMNS(
CALENDAR(LWStart, LatestDate),
"Selection","LW"
),
ADDCOLUMNS(
CALENDAR(L52Start, LatestDate),
"Selection","L52"
)
)
RETURN
Result

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.