Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
FlowViz
Helper III
Helper III

Use slicer to change measure

Hi folks,

 

I have a report page like so:

Screenshot 2022-02-03 at 17.56.38.png

 

I want to calculate the percentage of time the WorkItemId (an item) was spent in an 'active' column vs. 'active' + 'waiting' column.
So for this example item (725), the only 'Active' column is 'In Test', therefore it should be:

4 / (0 + 38 + 40 + 63 + 4) = 3%

 

However if I chose a different item (696):

Screenshot 2022-02-03 at 17.56.26.png

 

the 'Active' columns are 'In Build' / 'In Test' / 'In Progress' so this would be

(5 + 63) / (129 + 38 + 5 + 63) = 29%

 

I want to be able to use the Column slicer to control the calculation, as users will need to select their 'waiting' columns...

 

Can this be done? Pbix file is available here

 

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @FlowViz ,

 

Check the steps.

1# create a slicer table and use it as slicer.

slicer = DISTINCT('WorkItems FlowEfficiency'[Column])

2# create a measure as below.

Measure 2 = 
var _active = SUMX(FILTER(ALLSELECTED('WorkItems FlowEfficiency'),'WorkItems FlowEfficiency'[Column] in VALUES(slicer[Column])),'WorkItems FlowEfficiency'[Measure])
var _all = SUMX(ALLSELECTED('WorkItems FlowEfficiency'),'WorkItems FlowEfficiency'[Measure])
return
_active/_all

Result:

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

5 REPLIES 5
FlowViz
Helper III
Helper III

Thank you! This is amazing 🙂

v-jayw-msft
Community Support
Community Support

Hi @FlowViz ,

 

Check the steps.

1# create a slicer table and use it as slicer.

slicer = DISTINCT('WorkItems FlowEfficiency'[Column])

2# create a measure as below.

Measure 2 = 
var _active = SUMX(FILTER(ALLSELECTED('WorkItems FlowEfficiency'),'WorkItems FlowEfficiency'[Column] in VALUES(slicer[Column])),'WorkItems FlowEfficiency'[Measure])
var _all = SUMX(ALLSELECTED('WorkItems FlowEfficiency'),'WorkItems FlowEfficiency'[Measure])
return
_active/_all

Result:

2.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
FlowViz
Helper III
Helper III

Bumping this to see if anyone had ideas?

FlowViz
Helper III
Helper III

I wanted the user to do this via the slicer (which is the "Column" column in the dataset), so if I want the user to select any "waiting" values and the formula to dynamically update based on selection...

v-jayw-msft
Community Support
Community Support

Hi @FlowViz ,

 

How do you define whether the column is 'active' or 'waiting'? By [StateCategory] column?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.