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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Lburgos
Frequent Visitor

Workdays and festive days

Hello, 

I have been trying build a measure with workdays and festive days. 

I have discounted sunday in my variable but when I trie to discount another holiday it continues returning 1 in this case 

 

 

Laboral Day = 
VAR EsFinDeSemana = Dates[Number Day] IN {7}
VAR EsFestivo = 
    NOT ISBLANK(RELATED(TablaFestivos[Descripcion]))
VAR DiaLaboral = 
    IF(NOT(EsFestivo || EsFinDeSemana),1,0)
RETURN
    DiaLaboral

 

 

For example:

Lburgos_0-1667233968003.png

 

January 6 is holiday but it counts as 1....

My table is related with a table that contains holidays 

Lburgos_1-1667234128201.png

 

Can somebody help me please?

 

Thanks in advance. 

 

 

 

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @Lburgos 

Here are the steps you can refer to :

(1)Here are my test data :

vyueyunzhmsft_0-1667266440363.png

(2)We can create a calculated column with this dax:

Column = var _isweekend = 'Date'[Number Day] in {7}
var _fest = RELATED('TablaFestivos'[Descripcion])
return
IF( _isweekend || _fest,0,1)

(3)Then we can meet your need , the result is as follows:

vyueyunzhmsft_1-1667266488237.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

 

View solution in original post

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @Lburgos 

Here are the steps you can refer to :

(1)Here are my test data :

vyueyunzhmsft_0-1667266440363.png

(2)We can create a calculated column with this dax:

Column = var _isweekend = 'Date'[Number Day] in {7}
var _fest = RELATED('TablaFestivos'[Descripcion])
return
IF( _isweekend || _fest,0,1)

(3)Then we can meet your need , the result is as follows:

vyueyunzhmsft_1-1667266488237.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

 

Hello @v-yueyunzh-msft

Your approach it's fine, it works like a charm. 

Thanks!

 

Best Regards 

Luis 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.