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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

How to Filter data and get record in DAX

I want to filter Worker table in DAX and get data like

Select * from Worker w
where w.Name <> "Once Off"

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Issue resolved.
CALCULATE(
SUM(InvoiceLines[Tons]),
FILTER(InvoiceLines, InvoiceLines[ITEMID] = InventoryStock[ITEMID]),
Filter(Worker, Worker[WORKERNAME] <> "Once Off")
)

View solution in original post

6 REPLIES 6
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

If you only want to filter columns in visual or data view, you can directly filter like below:

vyalanwumsft_0-1634525079954.png vyalanwumsft_2-1634525159679.png

If you want to use dax, you could create a measure.

flag = IF(MAX('Table'[Name])="Once Off",0,1)

then apply it into filter.

vyalanwumsft_3-1634526042857.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Issue resolved.
CALCULATE(
SUM(InvoiceLines[Tons]),
FILTER(InvoiceLines, InvoiceLines[ITEMID] = InventoryStock[ITEMID]),
Filter(Worker, Worker[WORKERNAME] <> "Once Off")
)
smpa01
Super User
Super User

@Anonymous  equivalent DAX query would be

//in SSAS
EVALUATE 
FILTER(Worker, Worker[Name]<>"Once Off")
//in PBI
Table = FILTER(Worker, Worker[Name]<>"Once Off")
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

No any trick to filter data in new column/new measure?

Yes there is. @Anonymous  but how does your data look like? Provide a sample and what is the end goal?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

I want this column of Worker table in a single column this is the end goal

Ashraf_HK_0-1634203241680.png

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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