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

Restar columnas

Hola

Mi objetivo final es hacer un procedimiento de informes automatizado, donde copiaré/pegaré cada mes un nuevo archivo de Excel (saldo de prueba de cada mes) en una carpeta y, a continuación, el resultado aparecerá en un panel de Power BI en un formato de matriz donde cada columna es un mes y otras columnas son Q1, Q2, 6 meses, etc. Cada fila representa los números de cuenta del balance. Los archivos originales tienen >100k filas/cuentas y la fecha está en un formato D/M/YYYY.

Mi problema es que el saldo del ensayo tiene números acumulativos, así que tengo que restar cada columna para tener el resultado de un mes específico, es decir, Mar - Feb - Cambio en marzo. ¿Alguna idea de cómo puedo abordar este problema?

Lamentablemente, no puedo compartir mis datos originales, así que creé la tabla de consulta de potencia y la matriz de informes en el panel con números ficticios.

Gracias de antemano!

Salud

Alex

Matrix Report.png

1 ACCEPTED SOLUTION

Parece que está intentando crear una medida calculada. Debe hacer esto como una COLUMNA.

Consulte el archivo pbix adjunto a continuación firma para referencia sobre lo que he hecho.


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

12 REPLIES 12
AllisonKennedy
Super User
Super User

¿Faltan filas de datos reales durante algunos meses? Supongo que desea filtrar por el [número de cuenta] - número de cuenta de fila actual, pero para la resta, ¿estamos buscando Feb siempre si el mes de fila actual es marzo, o simplemente estamos buscando la entrada anterior para ese mismo número de cuenta, incluso si el último antes de marzo es en enero en lugar de feb? Espero que tenga sentido...

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

Hola Alison,

Gracias por la respuesta. En mis datos reales hay miles de filas (número de cuenta) cada día, omití algunos meses en mi ejemplo ficticio. Cada número de cuenta muestra el ammount acumulativo, por lo que cada mes se hace más grande y más grande, PERO también hay algunos meses que siguen siendo los mismos (es decir, no se mueven).

Permítanme darles otro ejemplo,

example dashboard.png

Prueba algo como esto:

Change - CumulativeTotals[Value] - MAXX(FILTER(ALL(CumulativeTotals),EARLIER(CumulativeTotals[Date])>CumulativeTotals[Date] && CumulativeTotals[Account Number] ? EARLIER(CumulativeTotals[Account Number])),CumulativeTotals[Value])

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

Tengo este tipo de error,

"No se puede determinar un único valor para la columna 'CumulativeTotal' en la tabla 'Combinar'. Esto puede suceder cuando una fórmula de medida hace referencia a una columna que contiene muchos valores sin especificar una agregación como min, max, count o sum para obtener un único resultado."

¿Alguna idea o sugerencia?

Debe hacerlo como una COLUMNA calculada en la misma tabla Merge. La fórmula que sugerí no funcionará como medida debido a la forma en que se utiliza la función EARLIER.

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

Hice clic por error el botón "resuelto", lo siento 😕

Cuando intenté crear la nueva columna, siempre tuve un error en el ANTERIOR y más específico que la línea roja estaba debajo de la letra L, ¿alguna pista?

¿Puede compartir una captura de pantalla del error? Por lo general, no proporciona la función media de error, pero con suerte debe ser sólo un error de sintaxis.

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

Claro, aquí está el error y la función que utilicé

screenshot_error.pngscreenshot_func.png

Parece que está intentando crear una medida calculada. Debe hacer esto como una COLUMNA.

Consulte el archivo pbix adjunto a continuación firma para referencia sobre lo que he hecho.


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

Genial, problema resuelto! ¡El archivo que me enviaste ayudó mucho! ¡¡Gracias!! 🙂

¡De nada!

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

La idea/problema de alto nivel que tengo es que en la captura de pantalla,

Mientras cargo cada mes un nuevo Excel, automáticamente con la consulta de energía va por debajo del mes anterior y para hacer el informe final tengo que primero poner los valores en columnas por mes y luego calcular los cambios. (para que pueda crear fácilmente más columnas como año, 6 meses, trimestres KPI, etc.)

plan.png

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.