Forum Discussion

22LACMT's avatar
22LACMT
Helper III
3 years ago
Solved

Dax expression

Im trying to create a new column that sums the exposure by date.  the date column has 5 unique dates  this column should likewise only show 5 diffent totals.  this is my expression and I am getting errors.  ? 

 

Totaltier1PIT1 = CALCULATE(sum('Portfolio Percentage totals PIT'[Tier1Exposure]), 'Portfolio Percentage totals PIT'[ver])
 
sample 

 

  • Hi 22LACMT ,

     

    You can create a column as below:-

     

    Totaltier1PIT1 =
    CALCULATE (
        SUM ( 'Portfolio Percentage totals PIT'[Tier1Exposure] ),
        FILTER (
            'Portfolio Percentage totals PIT',
            'Portfolio Percentage totals PIT'[ver]
                = EARLIER ( 'Portfolio Percentage totals PIT'[ver] )
        )
    )

     

     

4 Replies

  • Samarth_18's avatar
    Samarth_18
    Community Champion

    Hi 22LACMT ,

     

    You can create a column as below:-

     

    Totaltier1PIT1 =
    CALCULATE (
        SUM ( 'Portfolio Percentage totals PIT'[Tier1Exposure] ),
        FILTER (
            'Portfolio Percentage totals PIT',
            'Portfolio Percentage totals PIT'[ver]
                = EARLIER ( 'Portfolio Percentage totals PIT'[ver] )
        )
    )

     

     

    • 22LACMT's avatar
      22LACMT
      Helper III

      If I wanted to group the exposure by a category using a category column and point in time would I use the above and add an additional filter funtion for the category column? 

      • Samarth_18's avatar
        Samarth_18
        Community Champion

        22LACMT , Yes you can add additional column as filter in the expression.