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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
FValluch
New Member

How to write conditional function in PQ

Hello, 

 

I have a few columns in PQ editor. I would need to write function into PQ: 

 

If column "E" => 5 milions, stay in the report

If column "E" <5 milions, then stay in the report only if suma (G:L) >500.000

So for example, all the lines from 2-20 should be visible and also line 21 and 23.

How to use function? Or is it possible to use function in the filter? 

FValluch_1-1695033428101.png

 

Many thanks for any advice.

1 ACCEPTED SOLUTION

hello, @FValluch 

Table.SelectRows(your_table, (x) => x[E] >= 5000000 or List.Sum(Record.FieldValues(Record.SelectFields(x, {"G", "H", "I", "J", "K", "L"}))) > 500000)

 and replace all chars with actual column names. 

 

View solution in original post

2 REPLIES 2
FValluch
New Member

There is a function in XLS, which is actualy working:

=KDYŽ([@Celkem]>=5000000;"REPORT";KDYŽ([@Suma]>=500000;"Report";NEPRAVDA))

hello, @FValluch 

Table.SelectRows(your_table, (x) => x[E] >= 5000000 or List.Sum(Record.FieldValues(Record.SelectFields(x, {"G", "H", "I", "J", "K", "L"}))) > 500000)

 and replace all chars with actual column names. 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.