Forum Discussion

jay_patel's avatar
jay_patel
Helper IV
5 years ago
Solved

Need Total for Working Hours

Hi Friends,

 

I am trying to get Total Working Hours as total value in subtotals like as spent hours. But now getting.
Here mentioning the image
Like mentioned in image need to like spent hour highlighted in big box. Need to get like that in working hour row also. 
Tried with costum column by using formula -- 

Working Hours1 = CALCULATE(SUM('Date'[WorkingDay]),FILTER('Date','Date'[Month-Year]=EARLIER('Date'[Month-Year])))*8



Thank in Advance.

 

 

  • Icey's avatar
    Icey
    5 years ago

    Hi jay_patel ,

     

    It is suggested to create a calculated column in your fact table, not in the Date table like below:

    Working Hours =
    CALCULATE (
        SUM ( 'Date'[WorkingDay] ),
        FILTER ( 'Date', 'Date'[Month-Year] = EARLIER ( 'Table'[Month-Year] ) )
    ) * 8
    

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Don't @jay_patel,

    It is suggested to create a calculated column in the fact table, not in the Date table as follows:

    Working Hours =
    CALCULATE (
        SUM ( 'Date'[WorkingDay] ),
        FILTER ( 'Date', 'Date'[Month-Year] = EARLIER ( 'Table'[Month-Year] ) )
    ) * 8
    

    hours.JPG

    Best regards

    ice cream

    If this post helps, consider Accepting it as the solution to help other members find it faster.

10 Replies

  • jay_patel , this seems like a column. Also calculation seem fine

     

    Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

     

     

    • jay_patel's avatar
      jay_patel
      Helper IV

       

      Thank you amitchandak  for replying, here I am mentioning the sample of data. need to get workhours total as spent hours.

       

       

       

       

       

       

      • Icey's avatar
        Icey
        Community Support

        Hi jay_patel ,

         

        It is suggested to create a calculated column in your fact table, not in the Date table like below:

        Working Hours =
        CALCULATE (
            SUM ( 'Date'[WorkingDay] ),
            FILTER ( 'Date', 'Date'[Month-Year] = EARLIER ( 'Table'[Month-Year] ) )
        ) * 8
        

         

        Best Regards,

        Icey

         

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.