Forum Discussion
Need help with this issue
In My dataset there is one column i.e.
Resource
Control
Electrical
TECH COMM
Mechanical
Fluid
Test
My requirement is to create a slicer. In that slicer there should two option to select "Yes" and "No" If the selection is "Yes" it should show all Resources Data and if the selection is "No" then it should exclude "TECH COMM" from the visual.
For That I have created this table in power bi-
Include TECH COMM Filter Table =
DATATABLE("Selection", STRING, {{"Yes"}, {"No"}}).
And Then I using this DAX in the filter
IF(
SELECTEDVALUE('Include TECH COMM Filter Table'[Selection], "Yes") = "No",
IF(MAX(Engineering_Projects_Dataset_V2[Resource]) = "TECH COMM", 0, 1),
1
)
It is working when the Resource column in present in the view but not filtering properly when resource column is there in the visual
4 Replies
- amitchandakSuper User
ajitsahoo8338 , Try like
Dynamic Resource Filter Measure =
VAR SlicerSelection = SELECTEDVALUE('Include TECH COMM Filter Table'[Selection], "Yes")
RETURN
SWITCH(
SlicerSelection,
"Yes", countrows(Table),
"No", calculate(countrows(filter(Table, Engineering_Projects_Dataset_V2[Resource]) <> "TECH COMM")),
countrows(Table)
)- ajitsahoo8338Helper III
Hello amitchandak Thank you for your response. In my visual, I have a project name with multiple measures. I need to filter the project name using that slicer.
- AnonymousNot applicable
Hi ajitsahoo8338 ,
It is working when the Resource column in present in the view but not filtering properly when resource column is there in the visualCould you please explain the specific problem you are encountering in the form of screenshots?
I created the data myself and tested it with the DAX you provided, but there was no problem on my side:
Or could you provide the complete structure of your data?
Best Regards,
Dino Tao- ajitsahoo8338Helper III
Hello Anonymous , I am attaching a structure of my data. Please check it. The DAX works when the Resource is present in the visual, but it does not work when I remove the resource from the visual.
Project Number Resource Recorded_Hours E0100 CONTROL 4 E0100 FLUID 0.5 E0100 MECHANICAL 10 E0100 TECH COMM 6710.4 E0117 ELECTRICAL 496.75 E0117 FLUID 699.4 E0117 MECHANICAL 1702 E0117 PROJECT 512 E0117 TECH COMM 270