Forum Discussion
Beginner - conditional filtering?
- 5 years ago
Hi, DennisSchlein
If you want to filter data before you use it in desktop, you can create a custom step in pq.
Like this:
= Table.SelectRows(#"Changed Type1", each [Criteria]=1 and [Requested pickup date]<>null or [Criteria]=2 and [ScanDate]<>null and List.Contains({14,15,16},[ScanTypeId]) /If you don’t want to limit other situations/ or [Criteria]>2)If you want to use it in table visual, you can create measure then use it in filter pane to filter data.
Like this:
Measure = IF ( MAX ( 'Table (2)'[Criteria] ) = 1 && MAX ( 'Table (2)'[Requested pickup date] ) <> BLANK (), 1, IF ( MAX ( 'Table (2)'[Criteria] ) = 2 && MAX ( 'Table (2)'[ScanDate] ) <> BLANK () && DISTINCT ( 'Table (2)'[ScanTypeId] ) IN { 14, 15, 16 }, 1, 0 ) )Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, DennisSchlein
If you want to filter data before you use it in desktop, you can create a custom step in pq.
Like this:
= Table.SelectRows(#"Changed Type1", each [Criteria]=1 and [Requested pickup date]<>null or [Criteria]=2 and [ScanDate]<>null and List.Contains({14,15,16},[ScanTypeId])
/If you don’t want to limit other situations/
or [Criteria]>2)
If you want to use it in table visual, you can create measure then use it in filter pane to filter data.
Like this:
Measure =
IF (
MAX ( 'Table (2)'[Criteria] ) = 1
&& MAX ( 'Table (2)'[Requested pickup date] ) <> BLANK (),
1,
IF (
MAX ( 'Table (2)'[Criteria] ) = 2
&& MAX ( 'Table (2)'[ScanDate] ) <> BLANK ()
&& DISTINCT ( 'Table (2)'[ScanTypeId] ) IN { 14, 15, 16 },
1,
0
)
)
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is excactly what I was looking for, and it works like a charm!
Thank you very much for the effort!