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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
POSPOS
Post Partisan
Post Partisan

Error when Passing parameter for date field

Hi all,

I am using SAP BW Bex query as source. I have a date variable in the bex query. I am tying to pass (current date-7) as start date and current data as end date.

POSPOS_0-1711578883768.png

 



Variables in Bex:

Variable Entry.png
I get an errror as below when I use the code.
Error.png
Can someone please suggest on how to fix this?

Thank you.

14 REPLIES 14
lbendlin
Super User
Super User

Read about Value.Is   and then adjust your Power Query code to account for both scenarios.  Easiest approach is to make a fake list out of a single value and then tailor the Bex query for lists.

@lbendlin -  could you pls provide steps on how to achieve using the fake list out of a single value you mentioned,

- use Value.Is to check if the parameter is a list

- if it is not, encase it in curly brackets

@lbendlin  - I looked at the parameter type in the backend query and it is not a list. I have also enclosed in curly brackets and still get the same error

Maybe post a less obfuscated version of your query?

@lbendlin  : I was now able to pass one parameter that I created.

Query.png

When I pass the second parameter "DatePar1", I get an error.

 

Query.png

Error:
Error.png

Can you please suggest.

what happens when you use

 

{ DatePar, DatePar1 }

@lbendlin  - changed the code as below.
Query.png
Error:
Error.png

What date format is your BW expecting? ISO8601?

@lbendlin  - This is the date format which works in BW.

POSPOS_0-1711640831523.png

Even in Power BI , the format is same:

POSPOS_1-1711640984739.png

 

these are not the same formats.  (and neither are good formats).  Can you specify the date in ISO8601?

@lbendlin  : changed the format :

POSPOS_0-1711642162553.png


I get the below error:
Error.png

That's a datetime.  You need to convert to datetime first and then to date.

 

But I am disappointed that SAP BW can't handle this natively.

@lbendlin  - I get the same issue as previously mentioned with date type as well.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors