Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I want to create a running total percentage of a column with filter.
Example:
I want to get the percentage of Hour column when I filter on a project on that period. The total percentage should always sum at 100% (Cumulative percentage on filtered project/projects).
| Hour | Project |
22-Jun-19 | 2 | A |
29-Jun-19 | 4 | A |
6-Jul-19 | 6 | B |
13-Jul-19 | 8 | A |
20-Jul-19 | 9 | B |
27-Jul-19 | 10 | C |
3-Aug-19 | 2 | C |
Appreciate, if anybody can help. Read a lot of posts and not able to find a soloution
Solved! Go to Solution.
Hi , @amirghaderi
Try to use the following measure :
Percentage = CALCULATE(SUM('Table'[Hour]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=MIN('Table'[Date])))/CALCULATE(SUM('Table'[Hour]),ALLSELECTED('Table'))
Here is a demo URL .
It shows as below:
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This worked. Not exactly sure how, but it did. Note to self: better formatting...
Hi , @amirghaderi
According to your description ,you can try measures as below:
Sum hour By Project = CALCULATE(SUM('Table'[Hour]),ALLEXCEPT('Table','Table'[Project]))
Percentage = SUM('Table'[Hour])/'Table'[Sum hour By Project]
Here is a sample I made:
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the response. But, the soloution does not work as I need to show the output as line curve in the chart. Maybe below screen shot show the problem better.
Maybe explaining it in more detail.
In the screenshot, EVFC% should be 100% at the end of graph for any filter (filter by project in this case, it may have multiple filter). It only goes to 100%, when there is no filter.
Hi , @amirghaderi
Try to use the following measure :
Percentage = CALCULATE(SUM('Table'[Hour]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=MIN('Table'[Date])))/CALCULATE(SUM('Table'[Hour]),ALLSELECTED('Table'))
Here is a demo URL .
It shows as below:
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you. It worked!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |