Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Mandatory Selection in Binary Slicer

Hello everyone,
I currently have a report which is fed with a table that contains orders from multiple customers for various years in which the orders may be in 1 of two states, Gross or Net. An order starts its existence in a Gross status and when it is delivered it is changed to Net.


Currently I’m displaying all the distinct customers for each Month on a report, however I need to allow the final user to display either Gross or Net orders, this could be easily attained with a filter/slicer, however there is the issue that if I want to see Gross orders I would also need to see Net orders (it would not make sense to see Gross orders only without the Net given that Net would already have been Gross at some point). So, I need the user to choose either only Net our Net and Gross, never Only Gross.


The only way to force a selection that I’m aware is through the Single Select” field, however this goes against what I need.


On a side note: I already tried a more complex approach that is to create a “dynamic metric” with a SWITCH function that Selects between two “static/normal metrics) for Gross and Net with the filters inside of them, however I’m not able to use these filters because I also need to use a DATESBETWEEN function which messes up these filters.


Any suggestions would be great.
Kind regards
JG

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the folllowing:

  • Create a disconnected table with the states (Gross and Net)
  • Add the following measure:
Filtering =
IF (
    SELECTEDVALUE ( 'StatesSlicer'[State] ) = "Net",
    COUNTROWS ( FILTER ( 'Table', 'Table'[State] = "Net" ) ),
    1
)

 

Use the measure has filter of your visualizations all values that aren't blank:

MFelix_0-1620302948359.png

 

MFelix_1-1620303149688.png

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

1 REPLY 1
MFelix
Super User
Super User

Hi @Anonymous ,

 

Try the folllowing:

  • Create a disconnected table with the states (Gross and Net)
  • Add the following measure:
Filtering =
IF (
    SELECTEDVALUE ( 'StatesSlicer'[State] ) = "Net",
    COUNTROWS ( FILTER ( 'Table', 'Table'[State] = "Net" ) ),
    1
)

 

Use the measure has filter of your visualizations all values that aren't blank:

MFelix_0-1620302948359.png

 

MFelix_1-1620303149688.png

Check PBIX file attach.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.