Forum Discussion
martaredondo
Helper II
6 years agoIf statement when importing excel
Hey all, I have an Excel file that I need to import to Power BI once a week. The problem is that sometimes a specific sheet exists, sometimes it doesn't. Is there a way to do an if statement ...
- 6 years ago
parry2k
Super User
6 years agomartaredondo not sure how you are importing the excel file, are you reading file from a folder or what? Can you share M code?
martaredondo
Helper II
6 years agoparry2k i'm reading the excel from sharepoint online, basic import.
The problem is the number of sheets in that excel is not fixed. It is an extraction from a tool our company uses and if there is no data asssociated to that export the sheet "disapears".
Imagine I have 2 sheets "Orders from Client A" and "Orders from Client B", if in that week I have no orders from client B the only sheet in my excel is "Orders from Client A". This is why I need to have a verification like IF "Orders fro Client B" do not exist THEN do nothing/put table in blank
- parry2k6 years ago
Super User
martaredondo gotcha, stay tuned.