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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Quiero mostrar el mes y año anterior con condiciones

El siguiente comando funciona bien al agregar una nueva columna

FORMAT(EOMONTH(DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW())),-1), "MMMM-YYYY")

Pero cuando trato de usarlo así

Check Empty = 
IF(ISBLANK('August''2020'[LSA]),(IF(ISBLANK('August''2020'[Description of the Change]),"*For the month of "& (FORMAT(EOMONTH(DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW())),-1), "MMMM-YYYY"))  & ", there were no compliant based Cos."), " "))

Muestra

Operator or expression '( )' is not supported in this context.

¿Qué es lo que es odioso? ¿Y cómo eliminar esto?

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@R_S-13697 , Puede usar la tabla de fechas y la inteligencia de tiempo

Ejemplo

Ventas MTD: CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

Last year MTD Sales ? CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales - CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
Mes detrás de Ventas: CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Año detrás de Ventas: CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únete a ella con la columna de fecha de tus hechos. Consulte :radacad sqlbi My Video Series Aprecia tus Felicitaciones.

View solution in original post

AllisonKennedy
Super User
Super User

Tiene un error de sintaxis. Daxformatter.com es un gran sitio para dar formato a su código:

AllisonKennedy_0-1604920942716.png

No estoy seguro de si esto es lo que estás buscando:

Comprobación Vacía ?
SI (
ISBLANK ( 'Agosto''2020'[LSA] ),
SI (
ISBLANK ( 'Agosto''2020'[Descripción del cambio] ),
"*Para el mes de "
& FORMATO (
EOMONTH ( FECHA ( Año ( AHORA () ) ), MES ( AHORA () ) ), DIA ( NOW () ) ), -1 ),
"MMMM-AAAA"
) & ", no había Cos basado en cumplir con las normas."
),
" "
)


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

4 REPLIES 4
AllisonKennedy
Super User
Super User

@R_S-13697 Sí, creo que faltaba un soporte cerca del final, aunque también quité algunos de los soportes adicionales que eran innecesarios


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

AllisonKennedy
Super User
Super User

Tiene un error de sintaxis. Daxformatter.com es un gran sitio para dar formato a su código:

AllisonKennedy_0-1604920942716.png

No estoy seguro de si esto es lo que estás buscando:

Comprobación Vacía ?
SI (
ISBLANK ( 'Agosto''2020'[LSA] ),
SI (
ISBLANK ( 'Agosto''2020'[Descripción del cambio] ),
"*Para el mes de "
& FORMATO (
EOMONTH ( FECHA ( Año ( AHORA () ) ), MES ( AHORA () ) ), DIA ( NOW () ) ), -1 ),
"MMMM-AAAA"
) & ", no había Cos basado en cumplir con las normas."
),
" "
)


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

@AllisonKennedy
Gracias por la ayuda y proporcionar un gran recurso (DAX Formatter). Creo que me faltaba un corchete, ¿no?
Mantente impresionante.

amitchandak
Super User
Super User

@R_S-13697 , Puede usar la tabla de fechas y la inteligencia de tiempo

Ejemplo

Ventas MTD: CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))

Last year MTD Sales ? CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
last year MTD (complete) Sales - CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))
Mes detrás de Ventas: CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Month))
Año detrás de Ventas: CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únete a ella con la columna de fecha de tus hechos. Consulte :radacad sqlbi My Video Series Aprecia tus Felicitaciones.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors