Forum Discussion

chlxco's avatar
chlxco
Frequent Visitor
4 years ago
Solved

Measure using time not totalizing - Complex one.. I guess.

good morning community. Im facing the following challenge. Consider this model Table Item Time Start Date End Date Time x month prj A  30  jan-2021  mar-2021  10 prj B  120  feb-...
  • v-janeyg-msft's avatar
    4 years ago

    Hi, chlxco 

     

    According to your description, Is the 'total' displayed incorrectly?

    If yes, you can try:

    Total Hours =
    SUMX (
        SUMMARIZE (
            Table,
            [Start Date],
            [End Date],
            [Time x Month],
            "a",
                CALCULATE (
                    SUM ( Table[Time x Month] ),
                    FILTER (
                        VALUES ( Table[Start Date] ),
                        Table[Start Date] <= MAX ( Dates[Date] )
                    ),
                    FILTER ( VALUES ( Table[End Date] ), Table[End Date] >= MIN ( Dates[Date] ) )
                )
        ),
        [a]
    )
    

    Did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please upload some insensitive data samples and expected output.


    Best Regards,

    Community Support Team _ Janey