Forum Discussion
Calculating Percentages for line items with data selected by slicer
- 8 years ago
Hi pAAmckelvey,
Based on my test, you can refer to below steps:
1.I have entered some sample data to test for your problem in below picture.
2.Create a new measure to calculate the percentage.
percentage = DIVIDE(SUM(Sheet2[Hours]),CALCULATE(SUM(Sheet2[Hours]),ALLSELECTED(Sheet2[Work Description])))
3.Create a Table visual and add the [Work Description] and the [Hours] field. Create a Slicer visual to add the [percentage] field. And now you can see the result.
You can also download the PBIX file to have a view.
Regards,
Daniel He
Hi pAAmckelvey,
Based on my test, you can refer to below steps:
1.I have entered some sample data to test for your problem in below picture.
2.Create a new measure to calculate the percentage.
percentage = DIVIDE(SUM(Sheet2[Hours]),CALCULATE(SUM(Sheet2[Hours]),ALLSELECTED(Sheet2[Work Description])))
3.Create a Table visual and add the [Work Description] and the [Hours] field. Create a Slicer visual to add the [percentage] field. And now you can see the result.
You can also download the PBIX file to have a view.
Regards,
Daniel He
Thank you so much v-danhe-msft! This worked like a charm!