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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Syndicate_Admin
Administrator
Administrator

filter Table of holidays

Hello, I have a measurement to calculate the delivery days, taking into account working days and holidays:

"DiasCierre = NETWORKDAYS ( PLZENT [F.PED] , PLZENT [F.Cie.PED] , 1 , VALUES ( FestPto [FechaFest] )"
Orders are from different PTOVTA outlets.
And the festive table contains the PTOVTA and FechaFest columns.
How do I get PTOVTA Fest to filter dates?
It currently takes into account the public holidays of all PTOVTA
1 ACCEPTED SOLUTION
v-jingzhan-msft
Community Support
Community Support

Hi @Joseluislg 

 

You can try something like below. It is a column formula here.

Delivery Days = 
VAR pto = PLZENT[PtoGestion]
RETURN
NETWORKDAYS(PLZENT[Start date], PLZENT[End date], 1, CALCULATETABLE(VALUES(FestPto[FechaFest]),FestPto[PtoGestion]=pto))

 

Additionally, if there is a relationship between two tables on PtoGestion column and the cross-filter direction is Single (PLZENT filters FestPto), you can also try this for a column

Delivery Days 2 = 
NETWORKDAYS(PLZENT[Start date], PLZENT[End date], 1, SELECTCOLUMNS(RELATEDTABLE(FestPto),"holidays",'FestPto'[FechaFest]))

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

2 REPLIES 2
v-jingzhan-msft
Community Support
Community Support

Hi @Joseluislg 

 

You can try something like below. It is a column formula here.

Delivery Days = 
VAR pto = PLZENT[PtoGestion]
RETURN
NETWORKDAYS(PLZENT[Start date], PLZENT[End date], 1, CALCULATETABLE(VALUES(FestPto[FechaFest]),FestPto[PtoGestion]=pto))

 

Additionally, if there is a relationship between two tables on PtoGestion column and the cross-filter direction is Single (PLZENT filters FestPto), you can also try this for a column

Delivery Days 2 = 
NETWORKDAYS(PLZENT[Start date], PLZENT[End date], 1, SELECTCOLUMNS(RELATEDTABLE(FestPto),"holidays",'FestPto'[FechaFest]))

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Syndicate_Admin
Administrator
Administrator

I tried this but it gives an error:

CALCULATE(NETWORKDAYS(PLZENT[F.PED],PLZENT[F.Cie.PED],1,values(Holidays[FechaFest])),Holidays[PtoGestion]=PLZENT[PtoGestion] )

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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