Forum Discussion
selecting multiple values in slicer
I have this graph which changes with the selection of slicer (single select)
Graph
The slicer logic is :
Anonymous ,Try a measure like. You can have a measure like this. I have used different logic for 5 , assuming that is total , you can change as per need
measure =
var _1 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="0 to 4 weeks"), R_MetricGroups[Metric Name])+0
var _2 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="5 to 12 weeks"), R_MetricGroups[Metric Name])+0
var _3 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="13 to 24 weeks"), R_MetricGroups[Metric Name])+0
var _4 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="24+ weeks"), R_MetricGroups[Metric Name])+0
var _5 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="Total"), R_MetricGroups[Metric Name])+0return
if(_5>0, FactORBacklogDaily[OR Backlog Cases Total (Internal)]if(_1 >0 , FactORBacklogDaily[OR Backlog Cases 0 to 4 Weeks (Internal)], 0) +
if(_2 >0 , FactORBacklogDaily[OR Backlog Cases 5 to 12 Weeks (Internal)], 0) +
if(_3 >0 , FactORBacklogDaily[OR Backlog Cases 12 to 24 Weeks (Internal)], 0) +
if(_4 >0 , FactORBacklogDaily[OR Backlog Cases 24 Plus Weeks (Internal)], 0)
)Hi, Anonymous
It’s my pleasure to answer for you.
According to your description,I think you can create a measure to calculate the desired result.
Like this:
Calculated Internal = VAR a = IF ( "0 to 4 weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 0 to 4 Weeks (Internal)], 0 ) VAR b = IF ( "5 to 12 weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 5 to 12 Weeks (Internal)], 0 ) VAR c = IF ( "13 to 24 weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 13 to 24 Weeks (Internal)], 0 ) VAR d = IF ( "24+ weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 24 Plus Weeks (Internal)], 0 ) RETURN IF ( "Total" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases Total (Internal)], a + b + c + d )If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- amitchandakSuper User
Anonymous ,Try a measure like. You can have a measure like this. I have used different logic for 5 , assuming that is total , you can change as per need
measure =
var _1 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="0 to 4 weeks"), R_MetricGroups[Metric Name])+0
var _2 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="5 to 12 weeks"), R_MetricGroups[Metric Name])+0
var _3 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="13 to 24 weeks"), R_MetricGroups[Metric Name])+0
var _4 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="24+ weeks"), R_MetricGroups[Metric Name])+0
var _5 = countx(filter(R_MetricGroups, R_MetricGroups[Metric Name]="Total"), R_MetricGroups[Metric Name])+0return
if(_5>0, FactORBacklogDaily[OR Backlog Cases Total (Internal)]if(_1 >0 , FactORBacklogDaily[OR Backlog Cases 0 to 4 Weeks (Internal)], 0) +
if(_2 >0 , FactORBacklogDaily[OR Backlog Cases 5 to 12 Weeks (Internal)], 0) +
if(_3 >0 , FactORBacklogDaily[OR Backlog Cases 12 to 24 Weeks (Internal)], 0) +
if(_4 >0 , FactORBacklogDaily[OR Backlog Cases 24 Plus Weeks (Internal)], 0)
) - v-janeyg-msftCommunity Support
Hi, Anonymous
It’s my pleasure to answer for you.
According to your description,I think you can create a measure to calculate the desired result.
Like this:
Calculated Internal = VAR a = IF ( "0 to 4 weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 0 to 4 Weeks (Internal)], 0 ) VAR b = IF ( "5 to 12 weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 5 to 12 Weeks (Internal)], 0 ) VAR c = IF ( "13 to 24 weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 13 to 24 Weeks (Internal)], 0 ) VAR d = IF ( "24+ weeks" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases 24 Plus Weeks (Internal)], 0 ) RETURN IF ( "Total" IN DISTINCT ( R_MetricGroups[Metric Name] ), FactORBacklogDaily[OR Backlog Cases Total (Internal)], a + b + c + d )If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thank you guys - amitchandak , v-janeyg-msft !! Both the solutions work. You guys are awesome!
Another question - As per client's requirement, one can multi select slicer options which displays the summation. For this I have built the logic as provided by you. Now the client is asking, if the "Total" button is selected, all the other buttons gets deselected. Is it even feasible ? If yes, how ?
- v-janeyg-msftCommunity Support
Hi, Anonymous
It seems that PBI does not support this feature.But in my formula,when you select ‘total’,other options are invalid and won't work.
If it doesn’t solve your problem, please feel free to ask me.
Best Regards
Janey Guo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi v-janeyg-msft ,
Thanks for your response! You are correct. WIhen I select ‘total’,other options are invalid and doesn't work. So logic wise, that's correct. But I wanted to show other buttons as deselected.
Anyway, thanks for your help. 🙂