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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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 @Anonymous 

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 @Anonymous 

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.

Anonymous
Not applicable

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. 

Anonymous
Not applicable
Anonymous
Not applicable

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.