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.
Hola
La tabla siguiente tiene 3 fechas de inicio para dos sitios (última columna).
Salida esperada: Como se puede ver en la siguiente tabla, para Kanchan la primera fecha de un sitio por sí sola se cambia al inicio del año (es decir, del 1 de abril de 2017 al 1 de enero de 2017) y de forma similar para FDC Aurangabad, la primera fecha se cambia a 1/1/2019. El resto de las fechas deben ser como son. Tengo 100 sitios y quiero hacer esto para todos. ¿Cómo debo proceder? Por favor, ayúdenme.
Fecha de inicio del contrato | Fecha de finalización del contrato | Precio completo de O&M | Nombre |
1/1/2017 | 31/3/2018 0:00 | 380 | Kanchan India Pvt. Ltd. |
1/4/2018 | 31/3/2020 0:00 | 410 | Kanchan India Pvt. Ltd. |
1/1/2019 | 31/8/2019 0:00 | 375 | FDC Aurangabad |
1/9/2019 | 31/3/2020 0:00 | 405 | FDC Aurangabad |
11/5/2020 | 31/12/2021 0:00 | 303 | Kanchan India Pvt. Ltd. |
12/5/2020 | 31/12/2021 0:00 | 385 | FDC Aurangabad |
@Amit @amitchandak @parry2k @az38 @jdbuchanan71 @mahoneypat @edhans @harshnathani @v-kellya-msft @MFelix @Ashish_Mathur @BA_Pete @ryan_mayu @kbuckvol @Alexander76877 @Petazo @Mariusz @TomMartens @Greg_Deckler @tjd @Sean @mikstra @AllisonKennedy @EricHulshof @briandpeterson @USG_Phil @vpatel55 @mwegener @v-piga-msft
¿Dónde desea que se produzca este cambio? ¿Durante ETL en Power Query (antes de cargar) o en el modelo mediante DAX (después de cargar la tabla)?
Hola @Kolumam ,
Debe agregar una nueva columna con el siguiente código:
Date of contract =
IF (
CALCULATE (
MIN ( 'Table'[Start Date of Contract] );
ALLEXCEPT ( 'Table'; 'Table'[Name] )
) = 'Table'[Start Date of Contract];
STARTOFYEAR ( 'Table'[Start Date of Contract] );
'Table'[End Date of Contract]
)
Si desea que esto sea dinamyc una medida que necesita para hacer la sintaxis siguiente:
Measure Date of contract =
IF (
CALCULATE (
MIN ( 'Table'[Start Date of Contract] );
ALLEXCEPT ( 'Table'; 'Table'[Name] )
) = SELECTEDVALUE('Table'[Start Date of Contract]);
STARTOFYEAR ( 'Table'[Start Date of Contract] );
SELECTEDVALUE('Table'[End Date of Contract])
)
Compruebe el archivo PBIX con ambas opciones.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsGracias @MFelix. para la respuesta clara.
Sin embargo, hay un error en la fórmula:
Fórmula correcta:
Date of contract =
IF (
CALCULATE (
MIN ( 'Table'[Start Date of Contract] );
ALLEXCEPT ( 'Table'; 'Table'[Name] )
) = 'Table'[Start Date of Contract];
STARTOFYEAR ( 'Table'[Start Date of Contract] );
'Table'[Start Date of Contract]
)
@Kolumam ,
Se ha corregido el error correcto al escribir el nombre de la columna recogida la primera con fecha en él 😄
Gran atrapada.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |