Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

*HELP* How can I count date range occurrence with multiple columns?

I am newbie to power Bi and I am trying to do a DATE RANGE count with multiple date count columns and I am sooooooooo LOST on how to solve my reporting need. I have been on this for past 16 hours in ...
  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    4 years ago

    Hi Anonymous ,

     

    To reach that, a table with one column contains "updated","created"... is necessary. like the following:

    Then create a measure via this code:

    Measure =
    VAR _Created =
        COUNTROWS ( FILTER ( 'Table', [Created] <> BLANK () ) )
    VAR _Resolved =
        COUNTROWS ( FILTER ( 'Table', [Resolved] <> BLANK () ) )
    VAR _Updated =
        COUNTROWS ( FILTER ( 'Table', [Updated] <> BLANK () ) )
    VAR _CHART_Date_of_First_Response =
        COUNTROWS ( FILTER ( 'Table', [[CHART]] Date of First Response] <> BLANK () ) )
    RETURN
        IF (
            HASONEVALUE ( 'Project Tab Column Name'[Project Tab Column Name] ),
            SWITCH (
                SELECTEDVALUE ( 'Project Tab Column Name'[Project Tab Column Name] ),
                "Created", _Created,
                "Resolved", _Resolved,
                "[CHART] Date of First Response", _CHART_Date_of_First_Response,
                "Updated", _Updated
            ),
            _CHART_Date_of_First_Response + _Created + _Resolved + _Updated
        )
    

    So, the result:

    Pbix in the end you can refer.

    Best Regards

    Community Support Team _ chenwu zhu

     

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