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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
edejes2
Advocate IV
Advocate IV

Calculate Days based on a single filter

 

Hello All, 

I am facing this issue as of now I am getting this results, but I need to be able to remove the weekends from this results. My days in the month should be 22 days.

 

=CACULATE(DATEDDIFF(MIN(Calendar_Table),ENDOFMONTH(Calendar_Table),DAY))

=DAY(ENOFMONTH(Calendar_Table)

 

I will appreciate any help provided.

 

Regards!

ED 

1 ACCEPTED SOLUTION

@edejes2

If you use connect live connection, please create the isworkingday column in the SSAS data source.

Regards,
Lydia

Community Support Team _ Lydia 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

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@edejes2,

Your image is corrupted and I am unable to view it. Do you want to calculate working days based on selected values in date slicer? If so, please check the following DAX and example.

1. Create a column using dax below.

isworkingday = IF(WEEKDAY('Calendar Table'[DateKey])=1 ||WEEKDAY('Calendar Table'[DateKey])=7,0,1)


2. Create a measure using dax below.

Workingdays = var maxdate=MAX('Calendar Table'[DateKey])
var mindate=MIN('Calendar Table'[DateKey])

return 
SUMX (
FILTER (
'Calendar Table',
'Calendar Table'[DateKey] >=mindate
&& 'Calendar Table'[DateKey] <=maxdate),
'Calendar Table'[isworkingday]
)

1.JPG

Regards,

Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yuezhe-msft

 

I am grateful for your help! I forgot to mention that I am using SSAS and based on that I have some limitations. 

 

Regards!

ED

@edejes2

If you use connect live connection, please create the isworkingday column in the SSAS data source.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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