Forum Discussion

lagacem's avatar
lagacem
Frequent Visitor
5 years ago
Solved

Count Number of Rows Based on Filter From Current Row

Hello all,   Looking for help on this as I can get it to work in Excel but am having a hard time figuring it out in Power BI. What I'm trying to accomplish is to have at the end of each row, a coun...
  • ERD's avatar
    5 years ago

    Hi @lagacem,

    You can try the next option:

    #StillOpenedInc = 
    VAR currentResolvedDate = SELECTEDVALUE('Table'[Resolved_date])
    VAR Result = 
        COUNTROWS(FILTER(
                ALL('Table'),
                currentResolvedDate > 'Table'[Opened_date] &&
                currentResolvedDate < 'Table'[Resolved_date]
            ))
    RETURN IF(ISBLANK(Result), 0, Result)