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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
EvertonRosa
Helper I
Helper I

Sum till business day

Hi ALL

 

I need a little help to adjust the following DAX function:

 

VAR FirstDay = STARTOFMONTH(dCalendar[ID Data])
RETURN

CALCULATE(SUM(fOportunies[total]),
   fOportunies[status] ="open",
   USERELATIONSHIP(dCalendar[ID Data],fOportunies[estimateddate]),
    fOportunies[createdon] <= FirstDay
)

The adjustment that I need to do is change that VAR FirstDay should consider the 5º business day of each month.

 

I do have on dCalendar table a defined struture to set business day, with 0 for NO and 1 for YES (id date is or not a business day).

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@EvertonRosa Probably need to ditch STARTOFMONTH and calculate your first day using something like MINX(FILTER(...),...) or CALCULATE(MIN(...),...) Hard to tell you specifically without a representation of your data. But basically filter to the same month and year and businessday = 1 and grab the min value.

 

This might help in the future: You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Greg

 

Here is my dCalendar

 

EvertonRosa_0-1631130697604.png

 

Chech column "Dia Útil". In case, i do want to adjust filter/code:

 fOportunies[createdon] <= FirstDay

 

"Firstday" should sum "Dia Útil" = 5 and get ID Data Value. Do you know how to do it?

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.