Forum Discussion
Using a parameter to filter my visual
- 1 year ago
Hi ditoparker , I have taken some sample of data based on your explination like this table Sheet1
I just worked on this data I have a solution on your requirement
Step1: Create a unrelated table "Selection" with this stringsStep2: Create the follwing measure to assign values to those selections
Measure = SWITCH( SELECTEDVALUE(Selection[Name]), "Joe",SUM(Sheet1[work]), "Everyone",CALCULATE(SUM(Sheet1[work]),Sheet1[name]="Everyone"))Step 3
This is the actual value of work as per the tableits showing Everyone=81, Joe=11, Total=92
Now take the "Name" column from Seletion table and take the measure created into cardwe can see overall value is shown under Joe and remaining value shown under everyone
I hope it gives the solution you want , let me know
Thank you
Hi ditoparker
Please follow these steps -
Step1: Create the using Dax below.
Selection Parameter =
DATATABLE(
"Selection Parameter", STRING,
"SortOrder", INTEGER,
{
{"Joe", 1},
{"Everyone", 2}
}
)
Use this Parameter in slicer.
Seep2: create Filter Measure using below Dax:
Filter Logic =
VAR SelectedValue = SELECTEDVALUE('Selection Parameter'[Selection Parameter], "Everyone")
RETURN
IF(
SelectedValue = "Joe",
1,
IF(
SELECTEDVALUE(P_Data[Name]) = "Everyone",
1,
0
))
Step3: Add the measure to your visual's filters:
Select your visual > Go to Filters pane > Drag "Filter Logic" measure to filters >
Set filter to show when value = 1
Result: Select "Joe" in slicer
Select "Everyone" in slicer
Best regards,
Ray Minds
http://www.rayminds.com
https://www.linkedin.com/company/rayminds/