The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I have 2 slicers and the I want the result text box in such a way that if I select the first slicer and don't select any option from the second slicer, the text should be based on only the selected first slicer option. Now comes the complicated part where if I keep the selected first slicer option and then also select an option from the second slicer, the text should only display the value of the second slicer.
Example -
Slicer 1 options -> A,B,C,D
Slicer 2 options -> P,Q,R,S
If I select slicer 1 option A and don't select anything from slicer 2, result should be A
If I keep the slicer 1 as A and also select for example Q from slicer 2, result should be Q
One thing to note is that the slicer 1 is connected to slicer 2 in such a way that whenever I select any option from slicer 1, options are filtered for slicer 2.
I am having a hard time to design a DAX formula for this.
Thanks!
Solved! Go to Solution.
Something like this should work:
Text Measure =
VAR varFirstSlicer =
SELECTEDVALUE( Table[Field] )
VAR varSecondSlicer =
SELECTEDVALUE( Table[Field2] )
VAR Result =
IF(
ISBLANK( varSecondSlicer ),
varFirstSlicer,
varSecondSlicer
)
RETURN
Result
If the second slicer has anything but 1 value selected, you'll get the first slicer value.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingIt worked, thank you!
Awesome. SELECTEDVALUE() is one of my favorite functions. If you have 1 value selected it returns it. If you have 2+ or none selected, it returns blank.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingSomething like this should work:
Text Measure =
VAR varFirstSlicer =
SELECTEDVALUE( Table[Field] )
VAR varSecondSlicer =
SELECTEDVALUE( Table[Field2] )
VAR Result =
IF(
ISBLANK( varSecondSlicer ),
varFirstSlicer,
varSecondSlicer
)
RETURN
Result
If the second slicer has anything but 1 value selected, you'll get the first slicer value.
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingUser | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
14 | |
11 | |
10 | |
9 |