Forum Discussion

stribor45's avatar
stribor45
Post Prodigy
1 year ago
Solved

How to summarize virtual table table

I am trying to summarize this virtual table (non base table) and of course I am getting error that the base table is expected. Can someone assist please.   DEFINE VAR C = ADDCOLUMNS ( ...
  • tamerj1's avatar
    tamerj1
    1 year ago

    stribor45 

    Missed the @ sign 😅

    DEFINE
        VAR C =
            ADDCOLUMNS (
                DISTINCT ( UNION ( DISTINCT ( 'A'[ID] ), DISTINCT ( 'B'[ID] ) ) ),
                "@COUNTRY",
                    MINX (
                        FILTER ( ADDRESS, ADRESS[USERID] = FORMAT ( [ID], "0" ) ),
                        RELATED ( 'Flags'[Country] )
                    )
            )
    
    EVALUATE
    GROUPBY ( C, [@Country], "Count", SUMX ( CURRENTGROUP (), 1 ) )