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
Daniels2204
Frequent Visitor

HOW TO FILTER A COLUMN HAVING REFERENCE ANOTHER COLUMN WITH DIRECTQUERY

Hi, Guys

 

Today I´ve problem when filter the column (TL_QUANTID), I only need their values ​​when column (R_E_C_D_E__L) is at =0.

 

It generates an error related to columns, it has not been possible to relate them, keep in mind that I am working in Directquery mode.

 

In the dates only need the values in blue, but is not possible.

 

Daniels2204_0-1598367406040.png

 

 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@Daniels2204 , what are trying to create where it is giving error. simple if should work as column in direct query

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, @amitchandak 

 

This is my problem, pleaese your help.

 

 

 

Daniels2204_0-1598373431114.png

 

Hi @Daniels2204 ,

 

Can't you filter you query using R_E_C_D_E__L = 0 ?

 

Also, your code refers to FILTER function, it returns a filtered table, you have to return a scalar value in order to get it working.

 

In this example, you can create something like, for calculated tables:

 

Filter = IF(TABLE[R_E_C_D_E__L] = 0, 1, 0) 

 

And this for measures:

 

Filter = IF(SELECTEDVALUE(R_E_C_D_E__L) = 0, 1, 0)

 

and filter the results.

 

I wouldn't bring the rows to the model in your case, filtering directly on your Query.

 

You can filter it using Power Query using Query Folding, if you have a compatible data source with it.

https://docs.microsoft.com/en-us/power-bi/guidance/power-query-folding



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

Proud to be a Super User!



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.