Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

2nd Calculated Column Formula

I have 3 Raw Data Columns (Date, Group, Number) and 1 Calculated Column (80). I'm trying to make a 2nd Calculated Column where the denominator is the sum of the first calculated column for each row o...
  • Anonymous's avatar
    Anonymous
    7 years ago

    HiAnonymous ,

     

    Try the following replace Table with your tablename

     

    Percents =
    VAR _total80 =
        CALCULATE (
            SUM ( 'Table'[80] ),
            FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) )
        )
    RETURN
        DIVIDE ( [80], _total80 )

    Cheers

     

    CheenuSing

  • Anonymous's avatar
    Anonymous
    7 years ago

    Hi Anonymous 

     

     

    _total80 is a temproary variable created to compute the totals of column named 80 in your dataset, for each date.

         FILTER ( 'Table', [Date] = EARLIER ( 'Table'[Date] ) )  checks if the current date is same as earlier row  date and groups them together.

     

    Cheers

     

    CheenuSing