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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
alya1
Helper V
Helper V

How to display sum value for first date in July of each year?

Hello,

I have a data table like below:

Date   ID   Number
7/1/201111
7/1/202222
7/2/201111
7/2/202222
... everyday till  
7/1/211111
7/2/211111
... everyday till  
7/2/222222
7/2/223332
... everyday till today  

 

I want to display a table visual like below only showing the sum of Number for the first date in each year's July like below: 

Date      Sum of Number
7/1/203
7/1/211
7/2/224


So far my table visual is just displaying every single date. Is there a measure to limit just the first date in every July?
Thank you very much!

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Try this approach

  1. Create a Calendar Table with calculated column formulas of Year, Month name and Month number.  Sort the Month name column by the Month number column.
  2. Create a relationship (Many to One and Single) from the Date column of the Data table to the Date column of the Calendar Table
  3. To your visual, drag Year and Month name from the Calendar Table
  4. Write these measures

Total = sum(Data[Number])

Total on first day = calculate([Total],datesbetween(calendar[date],min(calendar[date]),min(calendar[date])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Irwan
Super User
Super User

hello @alya1 

 

please check if this accomodate your need.

 

1. create a calculated column with following DAX for finding the minimum date of each July.

Min = 
var _Year = 'Table'[Date   ]
var _Date = EOMONTH('Table'[Date   ],-1)
var _Month = MONTH('Table'[Date   ])
Return
MINX(
    FILTER(
        'Table',
        'Table'[Date   ]>_Date&&
        _Month=7
    ),
    'Table'[Date   ]
)
Irwan_0-1724890532008.png

 

2. create new table with following DAX for displaying the result

Summarize = 
SUMMARIZE(
    FILTER(
        'Table',
        not ISBLANK('Table'[Min])
    ),
    'Table'[Min],
    "Sum of Number",
    CALCULATE(SUM('Table'[Number]),'Table'[Date   ]='Table'[Min])
)
Irwan_1-1724890600609.png

 

Hope this will help.
Thank you.

Thank you Irwan! I think I'm really close. But for the calculated column, I keep getting value 6/30/YYYY filled for all July dates. My raw data does have mostly everyday of the year. Do you know how to fix this so it returns the first date in July instead of 6/30th please? 

Hello @alya1 

 

I am not sure, but it should return 30-June because you are looking the first date in July.

Thats why in calculated column, the DAX will collect value greater than _date which is return as 30-June.

 

As you can see in example above, it will return as first date of July, and other month will be blank since you only want July.

 

Not sure, but please check again your DAX.

 

Thank you.

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.