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
wpf_
Post Prodigy
Post Prodigy

Cómo utilizar dateadd() con el valor seleccionado de una segmentación de fecha sin errores

Tengo matrix_2 donde quiero tomar el valor de fecha de una segmentación de datos que filtra matrix_1 y muestra los valores que se desfasa por -7 días. Por lo tanto, si muestra valores para el lunes en matrix_1, quiero matrix_2 mostrar los valores del lunes anterior.

Estoy usando dateadd(selectedvalue(table[transaction_date]), -7, día) pero estoy recibiendo error:

una función 'selectedvalue' se ha utilizado en una expresión true/false que se utiliza como expresión de filtro de tabla. Esto no está permitido. Espero que alguien pueda ayudar. Gracias.

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

¿Es la fecha de transacción la de la segmentación? DateAdd aceptará toda la columna, por lo que no debería tener que usar la función SelectedValue en absoluto, pero depende de qué más está sucediendo con las relaciones entre los datos de la matriz 2 y la fecha de transacción.

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
Ashish_Mathur
Super User
Super User

Hola

Asegúrese de que tiene una tabla de calendario y la segmentación de datos tiene la columna Fecha de esta tabla Calendario. Esta medida debería funcionar

•min(calendario[fecha])-7

Espero que esto ayude.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
AllisonKennedy
Super User
Super User

¿Es la fecha de transacción la de la segmentación? DateAdd aceptará toda la columna, por lo que no debería tener que usar la función SelectedValue en absoluto, pero depende de qué más está sucediendo con las relaciones entre los datos de la matriz 2 y la fecha de transacción.

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

Wow no sabía que se puede hacer eso sin la función selectedvalue. Funcionó, desafortunadamente no me ayudó con lo que quería hacer. Pero gracias, me ayudará en el camino.

@wpf_ Hemos detectado un problema desconocido. Publique una nueva pregunta con algunos datos de muestra y la salida deseada y podemos seguir ayudándole a obtener el resultado final que necesita.

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

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.