Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi there
I am currently working on a solution that needs to sum activities hours per user and makes a calculation based on static expected hour. Basically, a user can work in different activities and will be expected see a subtotal subtracting from expected hour on a decreasing scale.
In this example, you can find a data sample.
For Jsilva, I expected see on total column:
#1 line - Hours - Expected = 10 - 1 = 9
#2 line - Hours - Expected = 9 (previous calculation) - 3 = 6
#3 line - Hours - Expected = 6 (previous calculation) - 4 = 2
Is there a way to do that?
Solved! Go to Solution.
Hi @Johonnatan ,
Please try:
First create an index column:
Then apply the measure:
Measure = SELECTEDVALUE('Table'[Expected])-SUMX(FILTER(ALL('Table'),[Index]<=SELECTEDVALUE('Table'[Index])&&[User]=SELECTEDVALUE('Table'[User])),[Hours])
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Johonnatan ,
Please try:
First create an index column:
Then apply the measure:
Measure = SELECTEDVALUE('Table'[Expected])-SUMX(FILTER(ALL('Table'),[Index]<=SELECTEDVALUE('Table'[Index])&&[User]=SELECTEDVALUE('Table'[User])),[Hours])
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 10 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 6 | |
| 6 |