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
Anonymous
Not applicable

DAX Help - calculating days

Hi All,

 

I have a Power BI that I am creating for our ticketing system. The goal is to take the number of days that our employees have entered on all their tasks and add it to today to get a "Next Available Date" so that managers know who is available to work. I can do the calculation by itself but when I add it to a table it explodes everything out granularity wise. Any ideas?

 

Here is the DAX calc - 

Next Available Date = CALCULATE(IF(WEEKDAY(NOW()+SUM('Resource Availability'[Remaining Planned Days]),1)=1,NOW()+SUM('Resource Availability'[Remaining Planned Days])+1,IF(WEEKDAY(NOW()+SUM('Resource Availability'[Remaining Planned Days]),1)=7,NOW()+SUM('Resource Availability'[Remaining Planned Days])+2,NOW()+SUM('Resource Availability'[Remaining Planned Days]))))
 
Here is what the data model looks like -RA Data model.png
 
Just to recap, If I just put the Team and Users in a table, it filters correctly. I pick a team and only see those users. Once I add the DAX calc it explodes it out and I see all users regardless of the team selected.
 
Any ideas?
 
Thanks,
James
1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Modify your measure using dax below and check if it can meet your requirement.

Next Available Date =
CALCULATE (
    IF (
        WEEKDAY ( NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ), 1 ) = 1,
        NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ) + 1,
        IF (
            WEEKDAY ( NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ), 1 ) = 7,
            NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ) + 2,
            NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] )
        )
    ),
    ALLSELECTED ( Teams )
)

Community Support Team _ Jimmy Tao

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
Anonymous
Not applicable

Is it possible to import the resource availabiliy data from MS Projects and import into the Power BI model and create a Gantt chart visualization which displays an overview of what tasks/projects are assigned to people and gives an overview where people have available hours (as gaps in the chart), for the Project Managers to assign new projects/tasks to the available resources/people.

 

I hope someone understands what I am trying to achieve. 😅

v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Modify your measure using dax below and check if it can meet your requirement.

Next Available Date =
CALCULATE (
    IF (
        WEEKDAY ( NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ), 1 ) = 1,
        NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ) + 1,
        IF (
            WEEKDAY ( NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ), 1 ) = 7,
            NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] ) + 2,
            NOW () + SUM ( 'Resource Availability'[Remaining Planned Days] )
        )
    ),
    ALLSELECTED ( Teams )
)

Community Support Team _ Jimmy Tao

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.