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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

How to filter out rows from calculation

Hi all,

 

I was wondering if anybody could help me with what I think should be achieved very simply in DAX - I just can't find the right function!

 

I have two columns of data, let's say Column A and Column B. I'd like to SUM Column A based on the values in Column B.

With the example data below, I'd like to sum Column A for all values in Column B EXCLUDING blanks and 'Don't know'. So my total sum should be only for 'yes' and 'no' and therefore be 65. So my question is: how do I exclude specific values in a column from a calculation?

Harriet_1-1624962083285.png

Any help much appreciated!

Thanks 😊

 

 

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Picture1.png

 

Result measure =
SUMX ( FILTER ( 'Table', NOT ( 'Table'[B] IN { "D", "" } ) ), 'Table'[A] )

 

 

https://www.dropbox.com/s/ou6ab6bsvhri2pe/harriet.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Picture1.png

 

Result measure =
SUMX ( FILTER ( 'Table', NOT ( 'Table'[B] IN { "D", "" } ) ), 'Table'[A] )

 

 

https://www.dropbox.com/s/ou6ab6bsvhri2pe/harriet.pbix?dl=0 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

CNENFRNL
Community Champion
Community Champion

Excel, our oldie but goodie does the trick with ease,

Untitled.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

Thanks for this, but I need to do this within Power BI using a measure

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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

Top Kudoed Authors