Forum Discussion
Filter Table with OR condition on different columns
Hello everyone,
I would like to filter a table on its Date-Values and on some Status-Values, e.g:
| ID | Date | Status |
| 1 | Dec. 2019 | 1 |
| 2 | Jan. 2020 | 1 |
| 3 | Feb.2020 | 2 |
| 4 | Mar.2020 | 2 |
| 5 | Apr. 2020 | 3 |
The user should be able to select a Data-Range with a Slicer Visual and a selection of Multiple Status-Values from a list (maybe a Slicer Visual as well). The resulting Table should contain rows which are either in the data-range or have a status equal to one of the selected status-values
e.g: Date-Range Jan.2020 - Feb.2020 and Status-Values: 1,2 should return table with IDs: 1,2,3,4
What would be the best way to achieve that? Any hints are appreciated very much!
Hi dominikRieder ,
Create a calendar table and a status table to use on your slicers now add the following measure to your data:
Measure = IF ( ( SELECTEDVALUE ( 'Table'[Date] ) <= MAX ( 'Calendar'[Date] ) && SELECTEDVALUE ( 'Table'[Date] ) >= MIN ( 'Calendar'[Date] ) ) || SELECTEDVALUE ( 'Table'[Status] ) IN VALUES ( 'Status'[Status] ); 1; BLANK () )Now filter you information based on the value 1 of the measure check the PBIX file attach.
4 Replies
- MFelixSuper User
Hi dominikRieder ,
Create a calendar table and a status table to use on your slicers now add the following measure to your data:
Measure = IF ( ( SELECTEDVALUE ( 'Table'[Date] ) <= MAX ( 'Calendar'[Date] ) && SELECTEDVALUE ( 'Table'[Date] ) >= MIN ( 'Calendar'[Date] ) ) || SELECTEDVALUE ( 'Table'[Status] ) IN VALUES ( 'Status'[Status] ); 1; BLANK () )Now filter you information based on the value 1 of the measure check the PBIX file attach.
- dominikRiederFrequent Visitor
Hi MFelix, thank you for the quick reply. I will try that out and let you know whether it worked for me
- amitchandakSuper User
dominikRieder , Not sure I got it.
If you simply put them in a table visual and put slicer it should do
If needed add a measure count(Table[ID]) along with other .
- MFelixSuper User
Hi amitchandak ,
I also add to read the post twice the trick is that dominikRieder want one option or the other using slicers from the table he will get the AND not OR.
😀