The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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).
@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...
Greg
Here is my dCalendar
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?
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
24 | |
19 | |
12 | |
9 | |
7 |