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 September 15. Request your voucher.

Reply
lekkerbek
Helper IV
Helper IV

Parameter retrieving multiple sources

Hi,

 

I'm retrieving financial information from a database where administration have different division numbers. When I want to create a report I filter on division codes. That filter needs to be added to every table I retrieve. To make things easier I wonder if it is possible to create a parameter for this.

 

Currently the code is like this:

 

#"Filtered Rows" = Table.SelectRows(#"ExactOnlineREST.System.ExactInfo@eol_table", each [Division] = 1234 or [Division] = 5678),

 

Red is obviously the relevant part and in this example it's 2, but could also be more than 2 divisions.

I already tried to create a parameter and it does work for 1 division code. However it doesn't work when I enter multiple division codes.

 

Any thoughts?

 

1 REPLY 1
MFelix
Super User
Super User

Hi @lekkerbek ,

 

For this you can use the solutions given by this video https://www.youtube.com/watch?v=KnvSAAqfUX0

 

In this case what I did was to create a parameter :

MFelix_0-1695638017157.png

The I changed the code of the filter by the following:

= Table.SelectRows(#"Changed Type", each (List.Contains ( 
let
    ParameterSource = #"Division Parameter",
    ParameterTable = #table(1, {{ParameterSource}}),
    ParameterListValues = Table.ToList( Table.ExpandListColumn(Table.TransformColumns(ParameterTable, {{"Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1"))
in
    ParameterListValues
, [Division] ) ))

 

Full code below:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Tcq7DQAgDMTQXa6mCZ8As0TZfw2sVLh7kiNkajJStlAHiwoDXCrMf1vAqeDgUGGDTcp8", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Division = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Division", type text}}),
    #"Filtered Rows1" = Table.SelectRows(#"Changed Type", each (List.Contains ( 
            let
                ParameterSource = #"Division Parameter",
                ParameterTable = #table(1, {{ParameterSource}}),
                ParameterListValues = Table.ToList( Table.ExpandListColumn(Table.TransformColumns(ParameterTable, {{"Column1", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Column1"))
            in
                ParameterListValues
            , [Division] ) ))
in
    #"Filtered Rows1"

MFelix_1-1695638165141.png

 

MFelix_2-1695638172906.png

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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 Kudoed Authors