Forum Discussion
RD_PowerBI31
3 years agoFrequent Visitor
Matrix report -sliced data substract
I need to substract hours from Reg hours column in Power BI. How can I achieve the Final hours calculation in power BI
| Employee | Leave Type | Trans hrs | Regular Hrs |
| ABC | SIck Leave | 8 | 40 |
| ABC | Annual Leave | 6 | 40 |
| ABC | DH Leave | 4 | 40 |
| XYZ | SIck Leave | 12 | 40 |
| XYZ | Annual Leave | 10 | 40 |
| XYZ | DH Leave | 8 | 40 |
Report requiremnt as below. I am able to get the below report in matrix by placing Leave type in column section of Matrix view. But unable to do substract RH-total hrs.
| Employee | Reg Hrs | SL | AL | DH | Total | Final Hrs |
| ABC | 40 | 8 | 6 | 4 | 18 | 40-18 |
| XYZ | 40 | 12 | 10 | 8 | 30 | 40-30 |
3 Replies
- AnonymousNot applicable
You need to create a measure
Hrs = [Hrs] - [Total Hrs]- RD_PowerBI31Frequent Visitor
How do you pickup total hours, it will be generated dynamically. There is no column to hold total
- AnonymousNot applicable
If these are columns you can use SUM Function Hrs = Sum('Table'[Hrs]) - Sum('Table'[Total Hrs])