Forum Discussion
How to combine ( AND ) to column Syntax into 1 ?
Hi All
I have working column for filter REV :-
1_REV =
SWITCH(TRUE(),
'GL'[Reporting Code]>=00001 &&'GL'[Reporting Code]<=00019,"REV",
BLANK())
I also have working column for filter EXP :-
1_EXP =
SWITCH(TRUE(),
'GL'[Reporting Code]>=00100 &&'GL'[Reporting Code]<=00375,"EXP",
BLANK())
I like to combine above 2 syntax into 1 , so that when it selected , it will filter both REV and EXP , i try below it does not work :-
1_REVnEXP =
SWITCH(TRUE(),
'GL'[Reporting Code]>=00001 &&'GL'[Reporting Code]<=00019,"REV",
and
'GL'[Reporting Code]>=00100 &&'GL'[Reporting Code]<=00375,"EXP",
BLANK())
Hope some one can advise me where go wrong ?
Below link is my PBI file :-
Paul
Hi Paul,
I think this is what you're looking for:
1_REVnEXP = SWITCH( TRUE(), 'GL'[Reporting Code]>=00001 &&'GL'[Reporting Code]<=00019,"REV", 'GL'[Reporting Code]>=00100 &&'GL'[Reporting Code]<=00375,"EXP", BLANK() )Since the conditions for REV and EXP are mutually exclusive, the order doesn't matter.
Regards,
Owen
2 Replies
- OwenAuger
Super User
Hi Paul,
I think this is what you're looking for:
1_REVnEXP = SWITCH( TRUE(), 'GL'[Reporting Code]>=00001 &&'GL'[Reporting Code]<=00019,"REV", 'GL'[Reporting Code]>=00100 &&'GL'[Reporting Code]<=00375,"EXP", BLANK() )Since the conditions for REV and EXP are mutually exclusive, the order doesn't matter.
Regards,
Owen
- admin11
Memorable Member