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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JimiH
Frequent Visitor

Nesting #Filtered Rows in an IF statement?

Hello

 

I have a parameter setup that filters a number of quieries & charts I have setup.

 

Parameter Values are = "All,1,2,3,4,5,6,7,8,9,10,11"

 

Now the numerical values work fine but I also want to filter by 'All' the numbers also.

 

I'm thinking if I could have a nested query something like the following ,obviously the formatting would be different 🙂

 

let
    Source = Sql.Database("server1", "APro"),
    dbo_OEE_FOR_BI = Source{[Schema="dbo",Item="OEE_FOR_BI"]}[Data],

IF LineNumberPar = (1-11) then filter like the below

    #"Filtered Rows" = Table.SelectRows(dbo_OEE_FOR_BI, each [LocId]=LineNumberPar)

Else

Include all the records from Item="OEE_FOR_BI

in
    #"Filtered Rows"

 

Is that the right track?

 

Regards

 

Geoff

 

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

@JimiH,

 

In your scenario, you want to do it in your Power query, right? Actually, this requirement can be done by using Slicer easily. We can turn on Select All option.

Capture.PNG

 

Besides, here is a blog about IF statement in Power query for you reference.
http://www.excelguru.ca/blog/2014/08/27/the-if-function-in-power-query/

 

Regards,

Charlie Liao

 

View solution in original post

2 REPLIES 2
v-caliao-msft
Employee
Employee

@JimiH,

 

In your scenario, you want to do it in your Power query, right? Actually, this requirement can be done by using Slicer easily. We can turn on Select All option.

Capture.PNG

 

Besides, here is a blog about IF statement in Power query for you reference.
http://www.excelguru.ca/blog/2014/08/27/the-if-function-in-power-query/

 

Regards,

Charlie Liao

 

Right ok ,maybe I over think things

 

Cheers

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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