Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Community!,
I am relative new to Power BI and I'm trying to create something in my power bi report, but I can't seem to get it work. I hope someone can help me with this.
The goal is to calculate the ‘DueDate’ by calculating ‘Arrived_Date_Time’ (the startdate) + ‘DAYSTOSTOCK’ (these days are workdays!).
In my screenshot attached,
So what I want to achieve is a new single column with the calculated due date.
For example:
On 05/01/2023 stock arrived. It should be processed within 3 business days, so the due date should be 10/01/2023 ('Nextworkday3BE').
Already tried with an IF and a SWITCH (a.workday = 1, then b.Nextworkday1BE, a.workday = 2, then b.Nextworkday2BE, a.workday = 3 then b.Nextworkday3BE) but can't get it to work.
Can anyone advise me in this / have any tips?
Much appreciated!
Hi @EricBI90
please try
DueDate =
MAXX (
TableA,
SWITCH (
TableA[DAYSTOSTOCK],
1, RELATED ( TableB[Nextworkday1BE] ),
2, RELATED ( TableB[Nextworkday2BE] ),
3, RELATED ( TableB[Nextworkday3BE] )
) + TableA[Arrived_Date_Time]
)
Hi @tamerj1
Thank you for your suggestion! Your DAX seems to be OK but I get the following error message:
"The column 'DML DimDate[NextWorkday1BE]' either doesn't exist or doesn't have a relationship to any table available in the current context."
As you can see in the screenshots below, their is an relationship between the tables. And both fields are 'Date' types.
Any ideas?
(fyi,
table 'A' = VW_SLA_CALCULATIES, from database A
table 'B' = DimDate, from database B. Can it have something to do with that the tables are from two different sources?)
Apparently this a week relationship. The tables are from different sources. One is direct import and the other is direct query. Let me try to think of other way to do it.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
7 | |
7 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |