Forum Discussion
Jayasimha
4 years agoFrequent Visitor
Exclude/Include measure in slicer based on Yes/No column
Hello, I have a column in my data which has Yes or No. Below is a sample Accounts? Revenue Yes xxx Yes xxx No xxx I was trying to create a measure and put it into a slicer. I...
- 4 years ago
OK, now I get it 😊
Then your approach with the new table should work.
Then create the following measure:
Yes/No = VAR vSlicerValue = SELECTEDVALUE ( 'NewTable'[Include/Exclude] ) RETURN SWITCH ( vSlicerValue, "Exclude", CALCULATE ( SUM ( Data[Revenue] ), Data[Accounts?] = "Yes" ), "Include", SUM ( Data[Revenue] ) )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic
selimovd
Most Valuable Professional
4 years agoHey Jayasimha ,
you cannot use measures as slicers. This only works in a few scenarios.
Why don't you just use the column myTable[Accounts?] for the slicer? There you can slice for yes or no.
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic
Jayasimha
4 years agoFrequent Visitor
Hi selimovd,
Thank you for taking time and going through my question.
In the slicer I want to give only Yes or ALL(including both Yes and No). I don't want to give the user an option to select No as the revenue doesn't make sense when selected only for No.
Can a new column be included in slicers?
- selimovd4 years ago
Most Valuable Professional
OK, now I get it 😊
Then your approach with the new table should work.
Then create the following measure:
Yes/No = VAR vSlicerValue = SELECTEDVALUE ( 'NewTable'[Include/Exclude] ) RETURN SWITCH ( vSlicerValue, "Exclude", CALCULATE ( SUM ( Data[Revenue] ), Data[Accounts?] = "Yes" ), "Include", SUM ( Data[Revenue] ) )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic