Forum Discussion

ramasaurio's avatar
ramasaurio
Frequent Visitor
2 years ago
Solved

How to use aggregation on coalesced columns?

I'm trying to use the function COALESCE to fill in missing values in a column. Doing that was simple but when I try to use the values of that new measure, the aggregations show values as if it were ...
  • OwenAuger's avatar
    2 years ago

    Hi ramasaurio 

    If the logic is to coalesce at the date level, I would write measures as follows:

    Value A Sum = 
    SUM ( 'Table A'[value_A] )
    Value B Sum = 
    SUM ( Table_B[value_B] )
    coalesce_measure by date = 
    SUMX (
        VALUES ( dates[date] ), -- dates would also work
        COALESCE( [Value A Sum], [Value B Sum] )
    )

    Does this work for you?