Forum Discussion
shep123
8 years agoHelper I
Exclude vs All Slicer
Admittedly this is a very simplified view of the data set but ultimately what I want to do is create a slicer that either includes Federal in the visuals or does not. Order_ID Industry Amoun...
- 8 years ago
Hi shep123,
You can create a Flag table which has only one column containing two values "Federal" and "NonFederal", then create a measure using DAX below:
Count = IF ( SELECTEDVALUE ( Flag[Flag] ) = "Federal", CALCULATE ( COUNT ( Table1[Order_ID] ), ALLEXCEPT ( Table1, Table1[Industry] ) ), IF ( SELECTEDVALUE ( Flag[Flag] ) = "NoneFederal", IF ( MAX ( Table1[Industry] ) <> "Federal", CALCULATE ( COUNT ( Table1[Order_ID] ), ALLEXCEPT ( Table1, Table1[Industry] ) ), BLANK () ) ) )
PBIX here: https://www.dropbox.com/s/iqicxwd1ucu1zaq/Exclude%20vs%20All%20Slicer.pbix?dl=0Regards,
Jimmy Tao
v-yuta-msft
8 years agoCommunity Support
Hi shep123,
You can create a Flag table which has only one column containing two values "Federal" and "NonFederal", then create a measure using DAX below:
Count =
IF (
SELECTEDVALUE ( Flag[Flag] ) = "Federal",
CALCULATE ( COUNT ( Table1[Order_ID] ), ALLEXCEPT ( Table1, Table1[Industry] ) ),
IF (
SELECTEDVALUE ( Flag[Flag] ) = "NoneFederal",
IF (
MAX ( Table1[Industry] ) <> "Federal",
CALCULATE ( COUNT ( Table1[Order_ID] ), ALLEXCEPT ( Table1, Table1[Industry] ) ),
BLANK ()
)
)
)
PBIX here: https://www.dropbox.com/s/iqicxwd1ucu1zaq/Exclude%20vs%20All%20Slicer.pbix?dl=0
Regards,
Jimmy Tao
shep123
8 years agoHelper I
Thank you. This is what I was looking for but couldn't figure the simplest way to do this.