Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Is there a way to show data based on two sepcific values selected on a slicer?
I have this DAX code:
Productive Utilization = SWITCH(true(),
SELECTEDVALUE('Resource Slicer Values'[Slicer Options])="Billable productive hours" &&
SELECTEDVALUE('Resource Slicer Values'[Slicer Options])="Non-Billable productive hours",
CALCULATE(SUM('Resource Table'[Application Productivity Percentage])),
SELECTEDVALUE('Resource Slicer Values'[Slicer Options])="Total",
(CALCULATE(SUM('Resource Table'[Application Productivity Percentage])+SUM('Resource Table'[Productivity Percentage]))))
The bold part of the code doesn't seem to be working as intended as seen on the image below. The case is if I both select Billable productive hours and Non Billable productive hours, it should show the value under. However, it returns blank.
Solved! Go to Solution.
HI @msantillan,
In fact, your conditions not works. When you select multiple items, selected values not equal to each value. (single value is included in selected values)
I'd like to suggest you use 'in' operator with allselected function to compare with multiple values that you selected in the slicer.
Regards,
Xiaoxin Sheng
Try to count the values in a variable the use
Formula =
var _for = countx(filter('Resource Slicer Values','Resource Slicer Values'[Slicer Options] in {"Billable productive hours" ,"Non-Billable productive hours"}),
'Resource Slicer Values'[Slicer Options])
return
<Formula>
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
@Anonymous I'm afraid there is an error when I'm using your logic. See code and image below:
Thanks!
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |