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
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
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.