Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Count IDs which Increased/Decreased

Hi all,   Please please help me out with this. So this is my table (made using the power BI visual matrix). The rows are IDs and the columns are Dates, usually a week apart (but not always). The va...
  • v-deddai1-msft's avatar
    5 years ago

    Hi Anonymous ,

     

    Use something like:

     

    Count IDs changed at least once =
    VAR a =
        ADDCOLUMNS (
            SUMMARIZE ( 'Table', 'Table'[SKU] ),
            "VALUE",
                COUNTROWS (
                    DISTINCT (
                        SELECTCOLUMNS (
                            FILTER (
                                SUMMARIZE (
                                    'Table',
                                    'Table'[SKU],
                                    'Table'[Date],
                                    "PDQ", COUNT ( 'Table'[SKU] )
                                ),
                                'Table'[SKU] = EARLIER ( 'Table'[SKU] )
                            ),
                            "VAUE1", [PDQ]
                        )
                    )
                )
        )
    RETURN
        COUNTX ( FILTER ( a, [VALUE] >= 2 ), 'Table'[SKU] )

     

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

     

    Best Regards,

    Dedmon Dai