SUM of today

Hey guys i am a newbie and need some help 

I have a table named milk production of which I want to create a view that shows me the total sum of milk produced in the morning by every cow just today. For ex. - if cow 1 produced 5L and cow 2 produced 7L respectively today morning then I want their sum to be displayed which will be the sum of morning milk produced by all cows. Thanks

DAIRYMAN_0-1674393332009.png

 

Solved Solved
0 2 141
1 ACCEPTED SOLUTION

Consider:

  • Add a new Dates table with one row for each date.
  • Make your existing Volumes table's Date column a Ref type column to the Dates table.
  • In the Dates table, include a column (potentially a virtual column) to calculate what you need. When tables are referenced, that is straightforward by dereferencing the referenced table's automatically created reverse reference list. For example:
SUM([Related Volumes][Morning Milk])

 

View solution in original post

2 REPLIES 2

Consider:

  • Add a new Dates table with one row for each date.
  • Make your existing Volumes table's Date column a Ref type column to the Dates table.
  • In the Dates table, include a column (potentially a virtual column) to calculate what you need. When tables are referenced, that is straightforward by dereferencing the referenced table's automatically created reverse reference list. For example:
SUM([Related Volumes][Morning Milk])

 

If you want to just show todays production you could use the following by creating a virtual column within the same table:

SUM(SELECT(YourTableName[Morning Milk], [Date] = TODAY()))

Top Labels in this Space