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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
martaredondo
Helper II
Helper II

If al importar excel

Hola a todos,

Tengo un archivo de Excel que necesito importar a Power BI una vez a la semana. El problema es que a veces existe una hoja específica, a veces no existe.

¿Hay alguna manera de hacer una instrucción if al importar la hoja? Algo así como IF "SheetName" no existe Entonces no hacer nada/poner sólo encabezados. Estoy recibiendo errores constantes porque en ciertas semanas Power BI no puede encontrar la hoja.

Gracias por ayudar,

Marta

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@martaredondo

Puede usar Try expression para lidiar con ella.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@martaredondo

Puede usar Try expression para lidiar con ella.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft muchas gracias! Funciona perfectamente, esto es exactamente lo que necesito 😁

parry2k
Super User
Super User

@martaredondo no está seguro de cómo está importando el archivo de Excel, está leyendo el archivo de una carpeta o qué? ¿Puedes compartir el código M?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k estoy leyendo el Excel desde sharepoint en línea, importación básica.

El problema es que el número de hojas en ese excel no se soluciona. Es una extracción de una herramienta que utiliza nuestra empresa y si no hay datos asilados a que exportan la hoja "disapears".

Imagine que tengo 2 hojas "Pedidos del Cliente A" y "Pedidos del Cliente B", si en esa semana no tengo pedidos del cliente B la única hoja en mi excel es "Pedidos del Cliente A". Esta es la razón por la que necesito tener una verificación como SI "Pedidos del cliente B" no existen Entonces no hacer nada / poner la tabla en blanco

@martaredondo gotcha, mantente atento.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Top Solution Authors