Forum Discussion

iabramson's avatar
iabramson
Frequent Visitor
1 year ago
Solved

Running Total For Runs per year

How do I create a calculated text column in my data set of running total for the year based on run type and year. Basically looking for a column that is a unique identifier to use in a relationship w...
  • ryan_mayu's avatar
    ryan_mayu
    1 year ago

    iabramson 

    You don't have the same date in both tables, so you don't need to create relationship between tables. 

    you can try this

     

    Column =
    var _count1=countx(FILTER('Future runs','Future runs'[Date]<=EARLIER('Future runs'[Date])&&'Future runs'[Run]=EARLIER('Future runs'[Run])&&year('Future runs'[Date])=year(EARLIER('Future runs'[Date]))),'Future runs'[Date])
    var _count2=countx(FILTER('Table','Table'[Date]<='Future runs'[Date]&&'Table'[Run Type]='Future runs'[Run]&&year('Table'[Date])=year('Future runs'[Date])),'Table'[Date])
    return right(year('Future runs'[Date]),2)&'Future runs'[Run]&right("0"&(_count1+_count2),2)
     
    pls see the attachment below