Forum Discussion

nr83's avatar
nr83
Regular Visitor
5 years ago
Solved

Count Documents Issued within Certain Month

Hello,   I am hoping someone can help. I am very new to Power BI and fumbling my way through how it works with the help of this community and You Tube videos. If replying, please do so in an "idiot...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi nr83 ,

     

    The following is my solution, please point out if it is not right.

     

    1.Create a calculated table by New table under Calculations. Make sure that the new table is not related to the old table.

    Slicer = 
    DISTINCT (
        SELECTCOLUMNS (
            FILTER ( 'Table', [Workflow Start] <> BLANK () ),
            "YearMonth",
                YEAR ( [Workflow Start] ) & "-"
                    & FORMAT ( MONTH ( [Workflow Start] ), "00" )
        )
    )

     

    2.Create a measure to count the YearMonth which is selected.

    Count YearMonth =
    CALCULATE (
        COUNT ( 'Table'[Workflow Start] ),
        FILTER (
            'Table',
            MONTH ( 'Table'[Workflow Start] )
                = VALUE ( RIGHT ( SELECTEDVALUE ( 'Slicer'[YearMonth] ), 2 ) )
                && YEAR ( 'Table'[Workflow Start] )
                    = VALUE ( LEFT ( SELECTEDVALUE ( 'Slicer'[YearMonth] ), 4 ) )
        )
    )

     

    3.The result is this.

     

    You can check more details from here.

     

     

    Best Regards,

    Stephen Tao

     

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