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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
klp97
Helper I
Helper I

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 @klp97, 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 @klp97 

 

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!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors