Forum Discussion

zeroblack7's avatar
zeroblack7
Regular Visitor
5 years ago
Solved

DAX: Cumulative Comparison (Count row from table visual)

Hi, Community.   This is my first time post on community. Please advice if i'm doing something wrong.    I need some help for DAX to calculation on my report it a little bit complicate but I'll t...
  • AntrikshSharma's avatar
    5 years ago

    zeroblack7 File is attached below my signature, I have also included a custom Date table.

     

    GrowthStatusCount = 
    VAR CurrentDate =
        MAX ( Dates[Date] )
    VAR LastMonday =
        CurrentDate - WEEKDAY ( CurrentDate, 3 )
    VAR Result =
        FILTER (
            ADDCOLUMNS (
                CALCULATETABLE (
                    SUMMARIZE ( fSalesTable, Dates[Date], Dates[Day Name], dCompanyGroup[Company] ),
                    Dates[Date] = LastMonday
                ),
                "@Growth Status", [GrowthStatus]
            ),
            NOT ISBLANK ( [@Growth Status] )
        )
    RETURN
        COUNTROWS ( Result )