cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rtran
Helper I
Helper I

Pre-filtering nested tables before expanding

Hi! 

 

I have an issue where my dataset prior to tranforming is huge. I'm simply trying to filter out the unnecessary data of the nested tables in my odata service prior to expanding the tables.

 

I can't seem to figure out a solution where I can filter on records, while keeping all of the other data/columns.. is this possible? I tried converting the records to a table and it didn't yield the results I wanted because it gave me a table with only two columns, where all of the column headers from the records table turned into rows with the value and dropped all of the other data

 

rtran_5-1660249406544.png

 

And is it possible to filter on more than one value in the same column?

 

Thanks!!

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

There's no GUI button but the code looks just like any other filter step.

 

Here's an example you can paste into the Advanced Editor of a new blank query:

 

let
    Source =
    #table(
        type table [Date = date, Budget = number, Record = record],
        {
            {#date(2019,09,15), 500, [Code="001", Text="abc", Value=3]},
            {#date(2019,10,15), 600, [Code="002", Text="xyz", Value=5]},
            {#date(2019,10,31), 400, [Code="003", Text="ijk", Value=8]}
        }
    ),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Record][Code] = "003" or [Record][Value] = 5))
in
    #"Filtered Rows"

 

 

Preview:

AlexisOlson_0-1660251488407.png

AlexisOlson_1-1660251567100.png

View solution in original post

2 REPLIES 2
rtran
Helper I
Helper I

This is exactly what I needed and wanted, thank you so much!! Worked perfectly 

AlexisOlson
Super User
Super User

There's no GUI button but the code looks just like any other filter step.

 

Here's an example you can paste into the Advanced Editor of a new blank query:

 

let
    Source =
    #table(
        type table [Date = date, Budget = number, Record = record],
        {
            {#date(2019,09,15), 500, [Code="001", Text="abc", Value=3]},
            {#date(2019,10,15), 600, [Code="002", Text="xyz", Value=5]},
            {#date(2019,10,31), 400, [Code="003", Text="ijk", Value=8]}
        }
    ),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Record][Code] = "003" or [Record][Value] = 5))
in
    #"Filtered Rows"

 

 

Preview:

AlexisOlson_0-1660251488407.png

AlexisOlson_1-1660251567100.png

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors