PowerQuery - Pass Parameter from Cell Value replacing Variable from T-SQL Script

JonReyno

Board Regular
Joined
Jun 8, 2009
Messages
130
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am new to Power Query and I'm seeking some assistance. I have a script that I have created within SQL. Within the script, I have DECLARE'd and SET a variable for a 'Report Date'. This variable is used throughout the query and various date fields use this date.

Previously, when I have connected Excel to a SQL database, I create the script in SQL and then re-create it within Microsoft Query within Excel, so I can apply a parameter, but due to the complexity of this query, I'm not able to do that.

I can get the data to appear within Excel, but as soon as I try and create a parameter where the user can enter a date into a cell, it falls over. I have had various errors appear in different forms. The most common one appears to be around converting between a string and a date, but everything I have tried doesn't resolve it.

It's driving me a bit mad! So my question is, how can I get the report running based on the date that the user enters into a cell?

Any help would be gratefully received. I know nothing about DAX, so I can't seem to work out what I need to do. I foolishly thought it would be simple to resolve
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Watch MrExcel Video

Forum statistics

Threads
1,113,904
Messages
5,544,978
Members
410,647
Latest member
LegenDSlayeR
Top