Forum Discussion
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?
Any help much appreciated!
Thanks 😊
Result measure =
SUMX ( FILTER ( 'Table', NOT ( 'Table'[B] IN { "D", "" } ) ), 'Table'[A] )https://www.dropbox.com/s/ou6ab6bsvhri2pe/harriet.pbix?dl=0
3 Replies
- Jihwan_Kim
Super User
Result measure =
SUMX ( FILTER ( 'Table', NOT ( 'Table'[B] IN { "D", "" } ) ), 'Table'[A] )https://www.dropbox.com/s/ou6ab6bsvhri2pe/harriet.pbix?dl=0
- CNENFRNL
Community Champion
Excel, our oldie but goodie does the trick with ease,
- AnonymousNot applicable
Thanks for this, but I need to do this within Power BI using a measure