March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |