Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
pe2950
Helper I
Helper I

Sum Rows With Multiple Duplicate Date Values?

I'm trying to calculate a YTD value. Each row in my model should be counted as 1, and multiple rows may have the same timestamp. So for a given period i want to count all of the rows during that period. 

 

My data model has columns [ID], [Timestamp], and i created a numeric column called [count] with a value = 1. I then created a date table and create the relationship between the two on the timestamp column. The relationship is a 1[Date]:*[Timestamp]

 

My DAX looks like this:

 

SumOfCount = SUM(tableA[Count])

 

YTDSumOfCount = TOTALYTD([SumOfCount], DateConsult[Date])

 

Here is the output i get in a table, and below is the relationship -- I think my Date relationship is broken, but i'm not sure why

 

CropperCapture[377].jpgCropperCapture[376].jpg

 

 

 

 

1 REPLY 1
MattAllington
Community Champion
Community Champion

There are rules for date tables if you want inbuilt time intelligence to work. Have you followed these rules?  

https://exceleratorbi.com.au/power-pivot-calendar-tables/

 

Also is the data in your data table (timestamp) at the day level (i.e. No timestamp)?  

 

Alos note you dont need the count column. Just use countrows(tablename)



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.