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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
N0SH33N
Frequent Visitor

Add what if Parameter to Date column to add only work days in Visual Table

Hi Everyone,

I have created a what if parameter which I want to add to 'End Date' column dynamically . My end goal is to get the 'Expected Date'  that accounts  only working day increment i-e 'End Date' + working day from the parameter values.

For example if user choose the parameter =5, I want my table to change as per below: I already have a Calender Table with indicator 1, if it is woking day. I will appreciate your help to make this happen 🙂 TIA

End DateExpected Date
Saturday, May 1, 2021Friday, May 7, 2021
Sunday, May 2, 2021Friday, May 7, 2021
Monday, May 3, 2021Monday, May 10, 2021
Tuesday, May 4, 2021Tuesday, May 11, 2021
Wednesday, May 5, 2021Wednesday, May 12, 2021
Thursday, May 6, 2021Thursday, May 13, 2021
Friday, May 7, 2021Friday, May 14, 2021
Saturday, May 8, 2021Friday, May 14, 2021
Sunday, May 9, 2021Friday, May 14, 2021
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @N0SH33N 

Try this. 

create the column:

 

Column = SUMX(FILTER(Calender,Calender[Date]<=EARLIER(Calender[Date])),Calender[IsWorkDay])

 

Create the measure:

 

Measure = CALCULATE(MIN(Calender[Date]),FILTER(ALL(Calender),Calender[Column] = MAX(Calender[Column])+5))

 

See sample file attached below.

Result:

v-xiaotang_0-1621219422113.png

Besides,

v-xiaotang_1-1621219725516.png

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-xiaotang
Community Support
Community Support

Hi @N0SH33N 

Try this. 

create the column:

 

Column = SUMX(FILTER(Calender,Calender[Date]<=EARLIER(Calender[Date])),Calender[IsWorkDay])

 

Create the measure:

 

Measure = CALCULATE(MIN(Calender[Date]),FILTER(ALL(Calender),Calender[Column] = MAX(Calender[Column])+5))

 

See sample file attached below.

Result:

v-xiaotang_0-1621219422113.png

Besides,

v-xiaotang_1-1621219725516.png

 

Best Regards,

Community Support Team _ Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-xiaotang , I appreciate your help and yes it is working for me. Yes May 31st is a stat  holoday so that's why I used 0 as indicator. Thanks for reviewing though. 

N0SH33N
Frequent Visitor
N0SH33N
Frequent Visitor

Hi CNENFRNL,

I appreciate your quick reponse, However, My workday indicator column "IsWorkDay" is sitting in a different Table named 'Calender'. Can I make this measure to work in this scenario as well. 

Basically I have two table, one I posted above and second is Calender table with "IsWorkDay" column.

thanks

CNENFRNL
Community Champion
Community Champion

Assume that all weekends and holidays are indicated 0 as below,

Screenshot 2021-05-13 204457.png

Screenshot 2021-05-13 204937.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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