Forum Discussion

RD_PowerBI31's avatar
RD_PowerBI31
Frequent Visitor
3 years ago

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

 

 

EmployeeLeave TypeTrans hrsRegular Hrs
ABCSIck Leave840
ABCAnnual Leave640
ABCDH Leave440
XYZSIck Leave1240
XYZAnnual Leave1040
XYZDH Leave840

 

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.

 

EmployeeReg HrsSLALDHTotalFinal Hrs
ABC408641840-18
XYZ40121083040-30

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You need to create a measure
    Hrs = [Hrs] - [Total Hrs]

    • RD_PowerBI31's avatar
      RD_PowerBI31
      Frequent Visitor

      How do you pickup total hours, it will be generated dynamically. There is no column to hold total

  • Anonymous's avatar
    Anonymous
    Not applicable

    If these are columns you can use SUM Function    Hrs = Sum('Table'[Hrs]) - Sum('Table'[Total Hrs])