Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

MTD based on condition

Hi Team, I have to calculate MTD as I have a table which has 4 columns as below, I have caluclate MTD based on the date. Requirment = Number of yes under each account and divded by nuumber of rows ...
  • v-yalanwu-msft's avatar
    4 years ago

    Hi, Anonymous ,

    You could create a measure as follow:

    percent = 
    DIVIDE (
        CALCULATE (
            COUNT ( [Account] ),
            FILTER (
                ALLSELECTED ( 'Table' ),
                [Account] = MAX ( 'Table'[Account] )
                    && [Task Submision Status] = "Yes"
            )
        ),
        CALCULATE (
            COUNT ( [Account] ),
            FILTER ( ALLSELECTED ( 'Table' ), [Account] = MAX ( 'Table'[Account] ) )
        )
    )

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.