Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hola, tengo el siguiente problema. Tengo una segmentación de datos que filtra en un período de tiempo (por ejemplo, 01/01/2021 - 31/12/2021). Ahora quiero crear una segmentación de datos adicional que filtre en YTD, QTD o en valores MTD dependiendo de la fecha de finalización. Para ello he creado la siguiente Tabla Calculada y la he vinculado a mi calendario en el modelo:
Selección MTD/QTD/YTD =
VAR lastselecteddate =CALCULATE(
MAX(Datos[Fecha],
ALLSELECTED(Datos[Fecha]
)
VAR YearStart = CALCULAR(
INICIODEAÑO(datos[fecha],
AÑO(Datos[Fecha]=AÑO(última fechaseleccionada)
)
VAR Quarterstart = CALCULAR(
STARTOFQUARTER(Datos[Fecha],
AÑO(Datos[Fecha]=AÑO(última fecha),
TRIMESTRE(Datos[Fecha]=TRIMESTRE(última fechaseleccionada))
VAR MonthStart = CALCULATE(
STARTOFMONTH(Datos[Fecha],
MES(Datos[Fecha]=MES(última fechaseleccionada),
AÑO(Datos[Fecha]=AÑO(última fecha))
Resultado VAR =
SINDICATO(
ADDCOLUMNS(
CALENDAR(YearStart,lastselecteddate),
"Selección", "YTD"
),
ADDCOLUMNS(
CALENDAR(Quarterstart,lastselecteddate),
"Selección", "QTD"
),
ADDCOLUMNS(
CALENDAR(MonthStart,lastselecteddate),
"Selección", "MTD"
)
)
DEVOLUCIÓN
Resultado
Mi problema es: la nueva segmentación de datos YTD, QTD, MTD solo funciona si la fecha de finalización de mi segmentación de datos de período es en 2023 (últimas fechas disponibles de todo el conjunto de datos). Si elijo un período de tiempo anterior (por ejemplo, el año 2022) ya no funciona. ¿Puede alguien ayudarme a resolver este problema?
¿Ha intentado utilizar un grupo de cálculo? Es una forma conveniente de crear YTD / QTD / MTD.
https://www.sqlbi.com/articles/introducing-calculation-groups/
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.