Forum Discussion

amaleranda's avatar
amaleranda
Icon for Post Patron rankPost Patron
7 years ago
Solved

Find total duration based on virtual filtered table.

I have a difficult situation(to my limited DAX knowledge). Row Data tabel copied below.   I have a table like below. What I need is filter this tabel by maximum [Duration] (in this case Type = [Gri...
  • amaleranda's avatar
    amaleranda
    7 years ago

    Hi Jimmy,

     

    Seems like this could work for me.

     

    I have excluded some data in the miniute level granuality for the sake of simplicity. 

     

    My actual data looks like below. I need duration to calculate when only Avil column is '0'.

     

    This is just a 30min sample only involving only 3 equips only. I have about 150 other type of equips. 

     

    What I am trying here is to get the total duration of area where Avil is '0' based on the orginal explenation. I am using Time Brush to change the time in the report. 

     

    I can email my PBIX file if you want to have a look.

     

    You have been a great help so far.

     

    TimeEquipAvilAreaSubAreaGroup
    13:00BL1A1SA1G1
    13:01BL1A1SA1G1
    13:02BL1A1SA1G1
    13:03BL1A1SA1G1
    13:04BL1A1SA1G1
    13:05BL1A1SA1G1
    13:06BL1A1SA1G1
    13:07BL1A1SA1G1
    13:08BL1A1SA1G1
    13:09BL1A1SA1G1
    13:10BL1A1SA1G1
    13:11BL1A1SA1G1
    13:12BL1A1SA1G1
    13:13BL0A1SA1G1
    13:14BL0A1SA1G1
    13:15BL0A1SA1G1
    13:16BL0A1SA1G1
    13:17BL0A1SA1G1
    13:18BL0A1SA1G1
    13:19BL1A1SA1G1
    13:20BL1A1SA1G1
    13:21BL1A1SA1G1
    13:22BL1A1SA1G1
    13:23BL1A1SA1G1
    13:24BL1A1SA1G1
    13:25BL1A1SA1G1
    13:26BL1A1SA1G1
    13:27BL1A1SA1G1
    13:28BL1A1SA1G1
    13:29BL1A1SA1G1
    13:30BL1A1SA1G1
    13:00Gri1A1SA1G1
    13:01Gri1A1SA1G1
    13:02Gri1A1SA1G1
    13:03Gri1A1SA1G1
    13:04Gri1A1SA1G1
    13:05Gri1A1SA1G1
    13:06Gri1A1SA1G1
    13:07Gri1A1SA1G1
    13:08Gri1A1SA1G1
    13:09Gri1A1SA1G1
    13:10Gri1A1SA1G1
    13:11Gri1A1SA1G1
    13:12Gri1A1SA1G1
    13:13Gri0A1SA1G1
    13:14Gri0A1SA1G1
    13:15Gri0A1SA1G1
    13:16Gri0A1SA1G1
    13:17Gri0A1SA1G1
    13:18Gri0A1SA1G1
    13:19Gri0A1SA1G1
    13:20Gri0A1SA1G1
    13:21Gri0A1SA1G1
    13:22Gri0A1SA1G1
    13:23Gri0A1SA1G1
    13:24Gri0A1SA1G1
    13:25Gri0A1SA1G1
    13:26Gri0A1SA1G1
    13:27Gri0A1SA1G1
    13:28Gri0A1SA1G1
    13:29Gri0A1SA1G1
    13:30Gri0A1SA1G1
    13:00Cru0A1SA1G1
    13:01Cru0A1SA1G1
    13:02Cru0A1SA1G1
    13:03Cru0A1SA1G1
    13:04Cru0A1SA1G1
    13:05Cru1A1SA1G1
    13:06Cru1A1SA1G1
    13:07Cru1A1SA1G1
    13:08Cru1A1SA1G1
    13:09Cru1A1SA1G1
    13:10Cru1A1SA1G1
    13:11Cru1A1SA1G1
    13:12Cru1A1SA1G1
    13:13Cru1A1SA1G1
    13:14Cru1A1SA1G1
    13:15Cru1A1SA1G1
    13:16Cru1A1SA1G1
    13:17Cru1A1SA1G1
    13:18Cru1A1SA1G1
    13:19Cru0A1SA1G1
    13:20Cru1A1SA1G1
    13:21Cru1A1SA1G1
    13:22Cru1A1SA1G1
    13:23Cru1A1SA1G1
    13:24Cru1A1SA1G1
    13:25Cru1A1SA1G1
    13:26Cru1A1SA1G1
    13:27Cru1A1SA1G1
    13:28Cru1A1SA1G1
    13:29Cru1A1SA1G1
    13:30Cru1A1SA1G1
  • v-yuta-msft's avatar
    v-yuta-msft
    7 years ago

    amaleranda ,

     

    You just need to modify the dax of first table like below:

    New Table =
    SUMMARIZE (
        FILTER ( 'Table', 'Table'[Avil] = 0 ),
        'Table'[Type],
        "Duration", CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Type] ) ),
        "Start", CALCULATE ( MIN ( 'Table'[Time] ), ALLEXCEPT ( 'Table', 'Table'[Type] ) ),
        "End", CALCULATE ( MAX ( 'Table'[Time] ), ALLEXCEPT ( 'Table', 'Table'[Type] ) )
    )
    

    Community Support Team _ Jimmy Tao

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