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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

SAP BW - How to write conditional M statement to pass a range of values as a parameter

Hi community,

 

I am new in general to editing power query code so please be gentle and explicit in your guidance 🙂 I am querying SAP BW, and trying to limit data extracted (vs. filtering after it loads in PQ).

 

In the highlighted step below, I would like to not have to specify individual values, and instead, either use:

  • a range of values (10000091220000 - 10000091229999)
  • a wildcard (1000009122*)
  • an if loop (if [!V000010] starts with 1000009122, then grab the record, else don't)

klp97_1-1671654022366.png

Add Items expects individual selection for this parameter (see below). Is what I want to do even possible?

 

TIA

 

klp97_2-1671654418670.png

 

 

3 REPLIES 3
SebasSmit
New Member

Hi @Anonymous, did you find a solution for this problem? I am exploring the exact same issue at the moment...

v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can try using a MDX statement to filter when you first configure the connection. Use the SAP Business Warehouse (BW) Connector in Power BI Desktop - Power BI | Microsoft Learn

vjingzhang_0-1671790896332.png

The Basic MDX Query (MDX) | Microsoft Learn

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it. Highly appreciate your Kudos!

Anonymous
Not applicable

Hello, thank you for the suggestion. I am not familiar with writing MDX queries - do you have any specific guidance on how I might write the query for what I would like to accomplish?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors